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