Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
import subprocess
|
| 2 |
|
| 3 |
# Define the command to be executed
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
# Execute the command
|
| 7 |
-
result = subprocess.run(command, capture_output=True, text=True)
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
print("Errors:\n", result.stderr)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
import gradio as gr
|
| 20 |
from datetime import datetime
|
|
|
|
| 1 |
import subprocess
|
| 2 |
|
| 3 |
# Define the command to be executed
|
| 4 |
+
command = ["python", "setup.py", "build_ext", "--inplace"]
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# Execute the command
|
| 7 |
+
result = subprocess.run(command, capture_output=True, text=True)
|
|
|
|
| 8 |
|
| 9 |
+
# Print the output and error (if any)
|
| 10 |
+
print("Output:\n", result.stdout)
|
| 11 |
+
print("Errors:\n", result.stderr)
|
| 12 |
+
|
| 13 |
+
# Check if the command was successful
|
| 14 |
+
if result.returncode == 0:
|
| 15 |
+
print("Command executed successfully.")
|
| 16 |
+
else:
|
| 17 |
+
print("Command failed with return code:", result.returncode)
|
| 18 |
|
| 19 |
import gradio as gr
|
| 20 |
from datetime import datetime
|