Spaces:
Paused
Paused
Update app.py
Browse files12345677 unmodified lines1516171819202122232425import gradio as grimport subprocessdef run_command(command):try:# Run the command and capture the outputresult = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)7 unmodified linesreturn str(e)# Create a Gradio interfaceiface = gr.Interface(fn=run_command,inputs="text",outputs="text",title="Linux Command Runner",description="Enter a Linux command to execute and see the output.")# Launch the interfaceiface.launch()12345677 unmodified lines15161718192021222324252627import gradio as grimport subprocessdef execute_command(command):try:# Run the command and capture the outputresult = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)7 unmodified linesreturn str(e)# Create a Gradio interfaceiface = gr.Interface(fn=execute_command,inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your command here...", label="Command"),outputs="text",title="Command Prompt Interface",description="A simple web-based command prompt where you can run Linux commands.")# Launch the interfaceiface.launch()
app.py+8-6