CoolFace
Apppublic

Serg4451D/linux_execute

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py23 linesDownload Raw Back to root
1import gradio as gr2import subprocess3 4def execute_command(command):5    try:6        # Выполняем команду и получаем вывод7        result = subprocess.run(command, shell=True, capture_output=True, text=True)8        return result.stdout + result.stderr  # Возвращаем стандартный вывод и ошибки9    except Exception as e:10        return str(e)11 12# Создаем интерфейс Gradio13iface = gr.Interface(14    fn=execute_command,15    inputs="text",16    outputs="text",17    title="Linux Command Executor",18    description="Введите команду Linux для выполнения."19)20 21# Запускаем интерфейс22iface.launch()23