Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(cmd):
|
4 |
-
a = str(__import__("os").system(cmd + ">
|
5 |
|
6 |
-
return str(__import__("os").system("cat output.log"))
|
|
|
|
|
7 |
|
8 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
9 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
output = subprocess.check_output(['ls', '-l'])
|
5 |
+
print(output)
|
6 |
|
7 |
def greet(cmd):
|
8 |
+
# a = str(__import__("os").system(cmd + ">output.log 2>&1"))
|
9 |
|
10 |
+
# return str(__import__("os").system("cat output.log"))
|
11 |
+
output = subprocess.check_output(cmd.split())
|
12 |
+
return output
|
13 |
|
14 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
iface.launch()
|