Warum funktioniert "Importzeit" nicht für Time (), sondern funktioniert für Time.sleep ()? [Duplikat]Python

Python-Programme
Anonymous
 Warum funktioniert "Importzeit" nicht für Time (), sondern funktioniert für Time.sleep ()? [Duplikat]

Post by Anonymous »

Wenn ich von der Zeit importieren verwende, erkennt Python die Zeit nicht. Sleep (60) . Wenn ich jedoch die Importzeit verwende, erkennt Python nicht t = time () . Warum passiert das? Gibt es eine Möglichkeit, time () und time.sleep (x) im selben Programm zu verwenden?

Code: Select all

from time import time
#import time

intervalInMinute = 1
t = time()
while 1:
time.sleep(60)
< /code>
Die Art von Fehler, die ich erhalte, lautet: < /p>
Traceback (most recent call last):
File "myProg.py", line 9, in 
time.sleep(60)
AttributeError: 'builtin_function_or_method' object has no attribute 'sleep'

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post