Peeble commited on
Commit
4cafbd4
·
verified ·
1 Parent(s): 4bd8331

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -24
app.py DELETED
@@ -1,24 +0,0 @@
1
- import gradio as gr
2
- import subprocess
3
- import os
4
-
5
- UPLOAD_FOLDER = "uploads"
6
- os.makedirs(UPLOAD_FOLDER, exist_ok=True)
7
-
8
- def execute_exe(file):
9
- file_path = os.path.join(UPLOAD_FOLDER, file.name)
10
- file.save(file_path)
11
-
12
- try:
13
- result = subprocess.run(["bash", "run_exe.sh", file_path], capture_output=True, text=True, timeout=10)
14
- return result.stdout if result.stdout else "No output."
15
- except subprocess.TimeoutExpired:
16
- return "Execution timed out."
17
-
18
- with gr.Blocks() as app:
19
- gr.Markdown("### Upload an EXE file to execute")
20
- file_input = gr.File(label="Upload EXE")
21
- output_text = gr.Textbox(label="Execution Output")
22
- file_input.change(execute_exe, file_input, output_text)
23
-
24
- app.launch()