konstantinG commited on
Commit
b4f0c6f
1 Parent(s): 8172bbb

Update unzip.py

Browse files
Files changed (1) hide show
  1. unzip.py +9 -6
unzip.py CHANGED
@@ -2,11 +2,14 @@ import os
2
  import zipfile
3
 
4
  def unzip(zip_file):
5
- if not os.path.exists('img_folder'):
6
- os.makedirs('img_folder')
7
- print('1')
8
- with zipfile.ZipFile(zip_file, 'r') as zip:
9
- zip.extractall('img_folder')
10
- print('2')
 
 
 
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