Gradio-Terminal / app.py
PhoenixStormJr's picture
Update app.py
b7c7216 verified
raw
history blame
338 Bytes
import gradio as gr
import subprocess
def greet(command):
commandList = command.split(' ')
output = subprocess.run(commandList, stdout=subprocess.PIPE).stdout.decode('utf-8')
return f"{command}: \n {output}"
demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
if __name__ == "__main__":
demo.launch()