を使用するfrom time import timeと、Python2.7.3はを認識しませんtime.sleep(60)。しかし、を使用するimport timeと、Pythonはを認識しませんt=time()。なぜこれが起こるのですか?同じプログラムで使用できる方法はありますtime()か?time.sleep(x)
from time import time
#import time
intervalInMinute = 1
t = time()
while 1:
time.sleep(60)
私が得るエラーの種類は次のとおりです。
トレースバック(最後の最後の呼び出し):ファイル "myProg.py"、9行目、time.sleep(60)AttributeError:'builtin_function_or_method'オブジェクトに属性'sleep'がありません