[Tutor] time.sleep() error

geon geon at post.cz
Tue Aug 2 18:35:21 CEST 2005


sunny sunny napsal(a):

>Hi all,
>
>I am using time.sleep to stop my program execution for some time. I
>have imported time and am able to use it sucessfully in the main
>program.
>
>However if I use it in any function I get the following error:
>
>the time.sleep(1) command generates this error :
>TypeError : 'int' object is not callable 
>
>  
>

Dont you actually have something like this?:

from time import *

# somewhere you use sleep like this
sleep=10

# and then
sleep(1)

# you get:
#    sleep(1)
#TypeError: 'int' object is not callable

In this case you "overwrite" the original function sleep() with your/my
variable sleep....
Solution: rename your/my variable sleep to f.e. notAwake=10 :-)

-- 
geon





More information about the Tutor mailing list