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