Spaces:
Sleeping
Sleeping
Update extract.py
Browse files- extract.py +22 -11
extract.py
CHANGED
|
@@ -1,11 +1,22 @@
|
|
| 1 |
-
import zipfile
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.")
|