I am python and pygame noob, looked at the tutorial on loading sprites into my game, and I get a syntax error for this line of code
except pygame.error, message:
^
SyntaxError: invalid syntax
This is the whole block of code:
def load_image(self, image_name):
try:
image = pygame.image.load(image_name)
except pygame.error, message:
print "Cannot load image: " + image_name
raise SystemExit, message
return image.convert_alpha()
I did not check if the tutorial was for python 3.4.2 or not, did the syntax change?
Or is there something wrong with my code?
source
share