import sys,pygame
pygame.init()
size = width , height = 600,400
screen = pygame.display.set_mode(size)
tux = pygame.image.load("tux.png")
screen.blit(tux,(200,200))
screen.blit(tux,(0,0))
pygame.display.flip()
while 1:
ev = pygame.event.poll()
if ev.type == pygame.QUIT:
pygame.quit()
上面的代码显示了这个错误
---------------------------------------------------------------------------
error Traceback (most recent call last)
C:\Anaconda\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
169 else:
170 filename = fname
--> 171 exec compile(scripttext, filename, 'exec') in glob, loc
172 else:
173 def execfile(fname, *where):
C:\Users\digi.abhshk\Desktop\tux.py in <module>()
11 pygame.display.flip()
12 while 1:
--->13 ev = pygame.event.poll()
14 if ev.type == pygame.QUIT:
15 pygame.quit()
error: video system not initialized
我对 pygame 很陌生,这个错误是什么以及如何删除它?PS:tux 是我在这个文件中使用的 png 图像