Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
def run(command):
|
5 |
+
process = subprocess.Popen(list(command.split()), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
6 |
+
stdout_str, stderr_str = process.communicate()
|
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()
|