[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
>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

# and then

# 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 :-)


More information about the Tutor mailing list