[Tutor] Weird Error

Peter Otten __peter__ at web.de
Sat Dec 17 16:40:48 CET 2011


Ken G. wrote:

> I have use 'sleep.time(5)' in most of my program but the following error
> is throwing me for a loss.
> 
> import time
> Traceback (most recent call last):
>    File "/home/ken/Python2/Blood Glucose/BloodGlucose04ReadingTimed.py",
> line 63, in <module>
>      time.sleep(2)
> AttributeError: 'str' object has no attribute 'sleep'
> 
> Using the following is okay:
> 
> import time
> print "Now"
> time.sleep(2)
> print "Later"

Look for an assignment like

time = "whatever"

in module BloodGlucose04ReadingTimed.py.



More information about the Tutor mailing list