import error

cheeky tinydesks at gmail.com
Mon Jul 31 14:26:48 EDT 2006


Hi, all.

I now really like to program with Python, even though I'm a newbie. I
have difficulty in solving the following problem.

$ python
Traceback (most recent call last):
  File "x.py", line 6, in ?
    import calendar, time
  File "time.py", line 5, in ?
    now = time.time()
TypeError: 'module' object is not callable

I now see the above error message. The source code is the following.

$ cat -n x.py
     1  #!/usr/bin/python
     2
     3  import traceback
     4
     5  from datetime import date
     6  import calendar, time

I don't have the line now = time.time() which encountered an error in
the previous step. I removed that line but I still see the error.

Someone says I should reload time module. However, I can't even import
time module. That's why I can't even try to reload time module name.

What's wrong with me? I'm studying on Ubuntu Linux. On Window IDLE
doesn't seem to have this problem. I saw someone saying it could be
happening when running independent script. I don't know what is right.

I really would like to know what is going on my system and how to clear
the past information. Thank you.




More information about the Python-list mailing list