Spaces:
Runtime error
Runtime error
File size: 537 Bytes
b6a1e5a d6dcc79 f281f4e b6a1e5a 03b614c b6a1e5a d6dcc79 b6a1e5a 03b614c f281f4e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import subprocess
# Gantilah "app.py" dengan nama berkas aplikasi Python Anda
pip_script = "install -r requirements.txt"
batch_file_path = ".run.bat"
python_script = "entry_with_update.py"
# Argument yang ingin Anda tambahkan
additional_arguments = ["--always-cpu"]
# Gabungkan semua argumen
PIP = ["pip", pip_script]
command = ["python", python_script] + additional_arguments
# Jalankan skrip menggunakan subprocess
subprocess.run(PIP)
# subprocess.run(command)# Menjalankan file batch
subprocess.run([batch_file_path], shell=True)
|