terminal / app.py
xcx0902's picture
Update app.py
f05b73d verified
raw
history blame contribute delete
289 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(share=True)