File size: 379 Bytes
064fb2e
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
from subprocess import getoutput

def run(command):
    out = getoutput(f"{command}")
    return out

with gr.Blocks() as app:
    command = gr.Textbox(show_label=False, max_lines=1, placeholder="command")
    out_text = gr.Textbox(show_label=False)
    btn_run = gr.Button("run command")
    btn_run.click(run, inputs=command, outputs=out_text)

app.launch()