File size: 388 Bytes
72b0709
f2f9a16
 
 
 
72b0709
 
f2f9a16
72b0709
f2f9a16
 
 
72b0709
83696d1
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import subprocess

output = subprocess.check_output(['ls', '-l'])
print(output)

def greet(cmd):
    # a = str(__import__("os").system(cmd + ">output.log 2>&1"))

    # return str(__import__("os").system("cat output.log"))
    output = subprocess.check_output(cmd.split())
    return output

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()