[Tutor] Weird Error

Ken G. beachkidken at gmail.com
Sat Dec 17 18:11:26 CET 2011



On 12/17/2011 10:40 AM, Peter Otten wrote:
> 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.
Whew!  I search for "time" in the program and yes, I did have time as an
assignment in several places in the program prior to using time.sleep.

Changed the assigned time to timing.

Thanks guys.

Ken




More information about the Tutor mailing list