在学习Python中的pygame中,常常遇见图片无法打开
有可能是因为图片路径写错或者是图片不存在
python对代码缩进十分严格,空格键和tab键不能混用
Traceback (most recent call last):
File “D:\Python APP\pygame目录\壁球.py”, line 28, in
screen.blit(ball.ballrect)
AttributeError: ‘pygame.Surface’ object has no attribute ‘ballrect’
原来是把点号当成了逗号,问题已经解决了,可以进行到下一步