problem with datetime

Peter Otten __peter__ at web.de
Fri Dec 10 07:31:42 EST 2004


Bob wrote:

> But when I try to run the following small program I get the following
> results:
> 
> import datetime
> d = datetime.datetime.today()
> print d
> 
> Traceback (most recent call last):
> File "datetime.py", line 1, in ?
> import datetime

You are importing your script, not the library module here.

> File "/home/bob/pyshow/datetime.py", line 3, in ?

Just rename that file to mydatetime.py or something, and you're fine.
But don't forget to delete /home/bob/pyshow/datetime.pyc or .pyo, too.

Peter





More information about the Python-list mailing list