Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def greet(cmd):
|
4 |
-
a = str(__import__("os").system(cmd))
|
5 |
-
|
6 |
-
|
7 |
return a
|
8 |
|
9 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def greet(cmd):
|
4 |
+
# a = str(__import__("os").system(cmd))
|
5 |
+
output = subprocess.check_output(cmd.split())
|
6 |
+
a = output.decode('utf-8')
|
7 |
return a
|
8 |
|
9 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|