Saitama070 commited on
Commit
c6072b1
·
verified ·
1 Parent(s): 715696f

Update extract.py

Browse files
Files changed (1) hide show
  1. extract.py +22 -11
extract.py CHANGED
@@ -1,11 +1,22 @@
1
- import zipfile
2
- import os
3
-
4
- # Path to the uploaded zip file
5
- zip_path = "Trump-LipSync.zip"
6
-
7
- # Extract the zip file
8
- with zipfile.ZipFile(zip_path, 'r') as zip_ref:
9
- zip_ref.extractall()
10
-
11
- print("Zip file extracted successfully!")
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import zipfile
2
+ import os
3
+ import subprocess
4
+
5
+ # Path to the uploaded zip file
6
+ zip_path = "Trump-LipSync.zip"
7
+
8
+ # Extract the zip file
9
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
10
+ zip_ref.extractall()
11
+
12
+ print("Zip file extracted successfully!")
13
+
14
+ # Run the app.py file from the extracted folder
15
+ extracted_folder = "Trump-LipSync" # Name of the extracted folder
16
+ app_path = os.path.join(extracted_folder, "app.py")
17
+
18
+ if os.path.exists(app_path):
19
+ print("Running app.py...")
20
+ subprocess.run(["python", app_path])
21
+ else:
22
+ print("Error: app.py not found in the extracted folder.")