Spaces:
Runtime error
Runtime error
Commit
•
b4f0c6f
1
Parent(s):
8172bbb
Update unzip.py
Browse files
unzip.py
CHANGED
@@ -2,11 +2,14 @@ import os
|
|
2 |
import zipfile
|
3 |
|
4 |
def unzip(zip_file):
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
|
|
|
2 |
import zipfile
|
3 |
|
4 |
def unzip(zip_file):
|
5 |
+
zip_filename = zip_file
|
6 |
+
target_dir = 'img'
|
7 |
+
if not os.path.exists(target_dir):
|
8 |
+
os.makedirs(target_dir)
|
9 |
+
with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
|
10 |
+
zip_ref.extractall(target_dir)
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
|
15 |
|