转【Python】Python-skier游戏[摘自.与孩子一起学编程]

http://www.cnblogs.com/zhaoxd07/p/4914818.html

 我遇到的问题

问题1 self.image=pygame.image.load("skier_down.png")  error: Couldn't open skier_down.png

解决:需要将png文件与py代码放到同一个路径下

问题2  安装pygame

解决:


1.downlaod pygame
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame


2.
https://www.pygame.org/wiki/GettingStarted#Windows installation


Also, this page offers help with pip for windows users.

py -m pip install pygame --user


sample:
C:windowssystem32>cd C:UsershupengDesktop6
C:UsershupengDesktop6>py -m pip install pygame
Collecting pygame
Downloading pygame-1.9.3-cp36-cp36m-win_amd64.whl (4.2MB)

问题3  IndentationError:expected an indented block

解决:此时只需要在print前面加tab键就可以了,即:后面需要缩进。 (先回车在按空格)

https://jingyan.baidu.com/album/3065b3b68fdeb7becff8a435.html?picindex=1

原文地址:https://www.cnblogs.com/feiyun8616/p/7143505.html