linux - Python TypeError: 'module' object is not callable -


i run piece of code on mac in idle , works fine. when tried run same code on linux machine command line gave me error:

traceback (most recent call last):   file "time.py", line 1, in <module>     import time  file "/home/ugrad/user/time.py", line 3, in <module>  t1 = time.time()  typeerror: 'module' object not callable 

here code:

import time  t1 = time.time() size = 10000000 in range(size):     =     += 100     *= 35     val = (a == 839248637) t2 = time.time() res = t2-t1 print(res) 

what doing wrong here?

you named file time.py import time loads file instead python time module. change name different - ie. time-test.py


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -