Skip to content

Commit bab81d1

Browse files
committed
Update zip example for lesson 03
1 parent 859bbc2 commit bab81d1

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

03/03_zip.ipynb

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"cell_type": "code",
17-
"execution_count": null,
17+
"execution_count": 7,
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
@@ -113,7 +113,7 @@
113113
},
114114
{
115115
"cell_type": "code",
116-
"execution_count": null,
116+
"execution_count": 8,
117117
"metadata": {},
118118
"outputs": [],
119119
"source": [
@@ -122,16 +122,32 @@
122122
},
123123
{
124124
"cell_type": "code",
125-
"execution_count": null,
126-
"metadata": {},
127-
"outputs": [],
125+
"execution_count": 9,
126+
"metadata": {},
127+
"outputs": [
128+
{
129+
"data": {
130+
"text/plain": [
131+
"['03_exceptions.ipynb',\n",
132+
" '03_files_open.ipynb',\n",
133+
" '03_file_read_write.ipynb',\n",
134+
" '03_os.ipynb',\n",
135+
" '03_pathlib.ipynb',\n",
136+
" '03_zip.ipynb']"
137+
]
138+
},
139+
"execution_count": 9,
140+
"metadata": {},
141+
"output_type": "execute_result"
142+
}
143+
],
128144
"source": [
129145
"file_names"
130146
]
131147
},
132148
{
133149
"cell_type": "code",
134-
"execution_count": null,
150+
"execution_count": 10,
135151
"metadata": {},
136152
"outputs": [],
137153
"source": [
@@ -152,20 +168,19 @@
152168
},
153169
{
154170
"cell_type": "code",
155-
"execution_count": null,
171+
"execution_count": 13,
156172
"metadata": {},
157173
"outputs": [],
158174
"source": [
159175
"with zipfile.ZipFile('notebooks_compressed.zip', 'w', \n",
160-
" compression=zipfile.ZIP_DEFLATED,\n",
161-
" compresslevel=9) as zipobj:\n",
176+
" compression=zipfile.ZIP_DEFLATED) as zipobj:\n",
162177
" for name in file_names:\n",
163178
" zipobj.write(name)"
164179
]
165180
},
166181
{
167182
"cell_type": "code",
168-
"execution_count": null,
183+
"execution_count": 14,
169184
"metadata": {},
170185
"outputs": [],
171186
"source": [

0 commit comments

Comments
 (0)