我没有看过学习 Python 的完整教程,但我正在学习如何使用 pygame。我知道一些关于 Python 的事情,但不是很多,我现在正在尝试放置背景图像,教程说我必须使用这个函数:
def load_image(filename, transparent=False):
try: image = pygame.image.load(filename)
except pygame.error, message:
raise SystemExit, message
image = image.convert()
if transparent:
color = image.get_at((0,0))
image.set_colorkey(color, RLEACCEL)
return image
但是在我的编辑器(Pyscripter)中,该行except pygame.error, message:
有一个 sintaxis 错误,我不知道为什么,如果我删除它,以 raise 开头的行也有一个 sintaxis 错误......我该怎么办?提前致谢!