對於我正在使用time.time()
的掃雷遊戲,我導入了time
和pygame
。這是我的錯誤報告混合pygame.time()和time.time()
line 5, in save_score
end = time.time()
AttributeError: module 'pygame.time' has no attribute 'time'
在這裏你有,我沒有證明進口的時間和pygame的:
import sys, math, time
def save_score(name, size, mine):
end = time.time()
~
from pygame import *
如果任何人都可以解釋如何避免/修復這個錯誤,它會是多少讚賞。
你從'pygame import *'執行''時有衝突(檢查http://stackoverflow.com/questions/9916878/importing-modules-in-python-best-practice) – fredtantini