terminal / app.py
xcx0902's picture
Update app.py
ec3a3d2 verified
raw
history blame
279 Bytes
import gradio as gr
import subprocess
def run(command):
result = subprocess.run(command, shell=True, capture_output=True, text=True)
return f"STDOUT:\n{result.stdout}\nSTDERR:\n{result.stderr}\n"
demo = gr.Interface(fn=run, inputs="text", outputs="text")
demo.launch()