Spaces:
Sleeping
Sleeping
Update app.py
#1
by Luis-Filipe - opened
app.py
CHANGED
|
@@ -1,21 +1,14 @@
|
|
| 1 |
-
# Gradio version (app.py)
|
| 2 |
import gradio as gr
|
| 3 |
import subprocess
|
| 4 |
|
| 5 |
def run_emulator():
|
| 6 |
proc = subprocess.Popen(
|
| 7 |
-
["java", "-cp", "javapc-assembly-0.431.jar", "org.ldaniels528.javapc.ibmpc.app.IbmPcEmulator"],
|
| 8 |
stdout=subprocess.PIPE,
|
| 9 |
stderr=subprocess.PIPE
|
| 10 |
)
|
| 11 |
out, err = proc.communicate()
|
| 12 |
return out.decode("utf-8") + "\n" + err.decode("utf-8")
|
| 13 |
|
| 14 |
-
iface = gr.Interface(
|
| 15 |
-
fn=run_emulator,
|
| 16 |
-
inputs=[],
|
| 17 |
-
outputs="text",
|
| 18 |
-
title="IBM PC Emulator"
|
| 19 |
-
)
|
| 20 |
-
|
| 21 |
iface.launch()
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def run_emulator():
|
| 5 |
proc = subprocess.Popen(
|
| 6 |
+
["java", "-cp", "target/scala-2.13/javapc-assembly-0.431.jar", "org.ldaniels528.javapc.ibmpc.app.IbmPcEmulator"],
|
| 7 |
stdout=subprocess.PIPE,
|
| 8 |
stderr=subprocess.PIPE
|
| 9 |
)
|
| 10 |
out, err = proc.communicate()
|
| 11 |
return out.decode("utf-8") + "\n" + err.decode("utf-8")
|
| 12 |
|
| 13 |
+
iface = gr.Interface(fn=run_emulator, inputs=[], outputs="text", title="IBM PC Emulator")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
iface.launch()
|