Spaces:
Runtime error
Runtime error
Update app_t.py
Browse files
app_t.py
CHANGED
@@ -4,17 +4,29 @@ from os import path
|
|
4 |
from zipfile import ZipFile
|
5 |
from shutil import make_archive
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
-
def main():
|
12 |
if path.exists(filename):
|
13 |
print ("yes zip location exists.")
|
|
|
|
|
|
|
|
|
|
|
14 |
src=path.realpath(filename)
|
15 |
-
print("zip location:", src)
|
|
|
16 |
root_dir,tail = path.split(src)
|
|
|
|
|
|
|
|
|
17 |
extract_dir=root_dir+'/'+extract_dir
|
|
|
|
|
18 |
shutil.unpack_archive(filename, extract_dir, archive_format)
|
19 |
#shutil.make_archive("test","zip",root_dir)
|
20 |
print ("Archive file unpacked successfully.")
|
|
|
4 |
from zipfile import ZipFile
|
5 |
from shutil import make_archive
|
6 |
|
7 |
+
def main():
|
8 |
+
filename = "clipseg-master.zip"
|
9 |
+
extract_dir = "clipseg"
|
10 |
+
archive_format = "zip"
|
11 |
|
|
|
12 |
if path.exists(filename):
|
13 |
print ("yes zip location exists.")
|
14 |
+
|
15 |
+
print ("filename :: ", filename)
|
16 |
+
print ("extract_dir :: ", extract_dir)
|
17 |
+
print ("archive_format :: ", archive_format)
|
18 |
+
|
19 |
src=path.realpath(filename)
|
20 |
+
print ("zip location:", src)
|
21 |
+
|
22 |
root_dir,tail = path.split(src)
|
23 |
+
|
24 |
+
print ("split- root_dir:", root_dir)
|
25 |
+
print ("split- tail:", tail)
|
26 |
+
|
27 |
extract_dir=root_dir+'/'+extract_dir
|
28 |
+
print ("extract_dir:", extract_dir)
|
29 |
+
|
30 |
shutil.unpack_archive(filename, extract_dir, archive_format)
|
31 |
#shutil.make_archive("test","zip",root_dir)
|
32 |
print ("Archive file unpacked successfully.")
|