Luis-Filipe commited on
Commit
a16f396
verified
1 Parent(s): 2fc30f0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -6,7 +6,7 @@ import io
6
  from PIL import Image
7
 
8
  def run_pcbasic_code(code, timeout=60):
9
- """Executa o c贸digo PCBasic em modo headless e captura a sa铆da gr谩fica."""
10
  with tempfile.TemporaryDirectory() as tmpdir:
11
  code_path = os.path.join(tmpdir, "code.bas")
12
  img_path = os.path.join(tmpdir, "output.png")
@@ -16,8 +16,6 @@ def run_pcbasic_code(code, timeout=60):
16
  f.write(code)
17
 
18
  env = os.environ.copy()
19
- # For莽a o SDL a usar o driver 'dummy' para n茫o abrir uma janela nativa
20
- env["SDL_VIDEODRIVER"] = "dummy"
21
 
22
  try:
23
  process = subprocess.run(
@@ -26,7 +24,6 @@ def run_pcbasic_code(code, timeout=60):
26
  f"--run={code_path}",
27
  "--interface=sdl2",
28
  "--video=SDL2",
29
- # Remova a flag --fullscreen para n茫o tentar abrir uma janela
30
  "--output", img_path
31
  ],
32
  env=env,
 
6
  from PIL import Image
7
 
8
  def run_pcbasic_code(code, timeout=60):
9
+ """Executa o c贸digo PCBasic e captura a sa铆da gr谩fica."""
10
  with tempfile.TemporaryDirectory() as tmpdir:
11
  code_path = os.path.join(tmpdir, "code.bas")
12
  img_path = os.path.join(tmpdir, "output.png")
 
16
  f.write(code)
17
 
18
  env = os.environ.copy()
 
 
19
 
20
  try:
21
  process = subprocess.run(
 
24
  f"--run={code_path}",
25
  "--interface=sdl2",
26
  "--video=SDL2",
 
27
  "--output", img_path
28
  ],
29
  env=env,