sd / app.py
cloudwp's picture
Create app.py
3e5274f
raw
history blame
897 Bytes
import gradio as gr
import os
import runpodctl
def run_command(command):
# Überprüfung, ob der Befehl eingegeben wurde
if command:
output = os.popen(command).read()
return output
else:
return "Bitte geben Sie einen Befehl ein."
# Texteingabefeld erstellen
command_input = gr.inputs.Textbox(label="Enter command")
# Senden-Button erstellen
send_button = gr.inputs.Button(label="Send")
# Ausgabe erstellen
output_text = gr.outputs.Text(label="Output")
def run_app(command):
output = run_command(command)
return output
# Gradio Space erstellen
iface = gr.Interface(
fn=run_app,
inputs=command_input + send_button,
outputs=output_text,
title="Terminal-Befehl ausführen",
description="Geben Sie den gewünschten Befehl ein und drücken Sie 'Senden', um den Befehl im Terminal auszuführen.",
theme="default"
)
iface.launch()