Spaces:
Running
Running
| import zipfile | |
| import os | |
| import subprocess | |
| # Path to the uploaded zip file | |
| zip_path = "Trump-LipSync.zip" | |
| # Extract the zip file | |
| with zipfile.ZipFile(zip_path, 'r') as zip_ref: | |
| zip_ref.extractall() | |
| print("Zip file extracted successfully!") | |
| # Run the app.py file from the extracted folder | |
| extracted_folder = "Trump-LipSync" # Name of the extracted folder | |
| app_path = os.path.join(extracted_folder, "app.py") | |
| if os.path.exists(app_path): | |
| print("Running app.py...") | |
| subprocess.run(["python", app_path]) | |
| else: | |
| print("Error: app.py not found in the extracted folder.") |