Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,8 @@ import gradio as gr
|
|
2 |
import subprocess
|
3 |
|
4 |
def run(command):
|
5 |
-
|
6 |
-
|
7 |
-
return f"STDOUT:\n{stdout_str}\nSTDERR:\n{stderr_str}\n"
|
8 |
|
9 |
demo = gr.Interface(fn=run, inputs="text", outputs="text")
|
10 |
demo.launch()
|
|
|
2 |
import subprocess
|
3 |
|
4 |
def run(command):
|
5 |
+
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
6 |
+
return f"STDOUT:\n{result.stdout}\nSTDERR:\n{result.stderr}\n"
|
|
|
7 |
|
8 |
demo = gr.Interface(fn=run, inputs="text", outputs="text")
|
9 |
demo.launch()
|