小编Are*_*sfd的帖子

pygame事件处理

只是关于python和pygame事件处理的noob问题.

我在pygame教程中得到以下代码:

while 1:
   for event in pygame.event.get():
       if event.type in (QUIT, KEYDOWN):
            sys.exit()
Run Code Online (Sandbox Code Playgroud)

...但由于某种原因,它会返回此错误:

if event.type in (QUIT, KEYDOWN):
NameError: name 'QUIT' is not defined
Run Code Online (Sandbox Code Playgroud)

有谁能解释一下?

python pygame event-handling

2
推荐指数
1
解决办法
3129
查看次数

标签 统计

event-handling ×1

pygame ×1

python ×1