Spaces:
Sleeping
Sleeping
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() |