python问题求助
Tofloor
poster avatar
biewenyu
deepin
2016-03-05 19:52
Author
我正在学习python,写了一个小脚本,但是运行时出现了这样的问题
代码在此,恳请大神们指教。。。
Reply Favorite View the author
All Replies
avatar
biewenyu
deepin
2016-03-05 20:29
#1
而用pycharm则可以运行
Reply View the author
avatar
u855697021
deepin
2016-03-05 20:46
#2
在pygame.init()之前print(dir(pygame))一下试试看...
很明显错误原因是模块中没有init这个方法嘛,我想traceback和error message说的很清楚了...
Reply View the author
avatar
Feng Yu
deepin
2016-03-05 21:03
#3
不要把你的代码名字命名成pygame.py,否则import pygame实际是import你自己的代码,而不是pygame这个类库。

明显你的基础知识欠佳
Reply View the author
avatar
biewenyu
deepin
2016-03-05 22:27
#4
对。。。3楼说的对。。大神受教了。。Python放了很长时间没学,最近又拿出来
Reply View the author
avatar
biewenyu
deepin
2016-03-05 22:29
#5
不不不,是4楼
Reply View the author