run-duckdb-jobs / gradio.py
lhoestq's picture
lhoestq HF Staff
Rename gradio.app to gradio.py
0736fed verified
raw
history blame
431 Bytes
import subprocess
import sys
import gradio
def run():
process = subprocess.Popen(your_command, stdout=subprocess.PIPE)
logs = ""
for line in iter(process.stdout.readline, b""):
logs += "\n" + line.decode
yield logs
with gr.Blocks() as demo:
button = gr.Button("Run")
output_textbox = gr.Textbox()
button.click(run, outputs=[output_textbox])
if __name__ == "__main__":
demo.launch()