【发布时间】:2014-01-22 05:37:06
【问题描述】:
当我使用子进程通过菜单脚本打开我的游戏脚本时,我收到一个奇怪的错误,即使我尝试重新安装 python 或 pygame,我似乎也无法修复。我是在错误地使用代码还是什么?
~信息~ Python 版本 2.7.6 Pygame 版本 1.9.1
~错误给定~
> > Traceback (most recent call last): File "C:\Users\Jason\Desktop\Maze\menu.py", line 22, in <module>
> subprocess = Popen(['swfdump', 'main.py', '-d'], stdout=PIPE) File "C:\Python27\lib\subprocess.py", line 709, in __init__
> errread, errwrite) File "C:\Python27\lib\subprocess.py", line 957, in _execute_child
> startupinfo) WindowsError: [Error 2] The system cannot find the file specified
~ 我用于菜单的代码~
import pygame
import dumbmenu as dm
pygame.init()
from subprocess import Popen, PIPE
# Just a few static variables
red = 255, 0, 0
green = 0,255, 0
blue = 0, 0,255
size = width, height = 340,240
screen = pygame.display.set_mode(size)
screen.fill(blue)
pygame.display.update()
pygame.key.set_repeat(500,30)
choose = dm.dumbmenu(screen, [
'Start Game',
'Quit Game'], 64,64,None,32,1.4,green,red)
if choose == 0:
pprocess = Popen(['swfdump', 'main.py', '-d'], stdout=PIPE)
stdout, stderr = process.communicate()
elif choose == 1:
pygame.quit()
exit()
【问题讨论】:
标签: python python-2.7 pygame