localtime import not working

U

Udo Melis

udo:/usr/lib/cgi-bin# python
Python 2.3.4 (#2, Jul 28 2004, 09:39:34)
[GCC 3.3.4 (Debian 1:3.3.4-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/cgi-bin/time.py", line 3, in ?
NameError: name 'localtime' is not defined

What can i do?
 
J

Jeff Epler

Don't give your script the same name as a built-in module, or don't give
your script a .py extension.

Be sure to remove the .pyc version of your file too, or that will be found
intstead of the real time module, even after your time.py is removed.

This is probably in the faq...

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBSNxQJd01MZaTXX0RAj3vAJ9h9mL0ja8DczqeqXgFvxlVGwTUmgCfaPzp
5kkQZU8G56SUyZkorg5Z6WM=
=2XxU
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top