How to keep a module with the same name as a module it is importing from importing itself?

plb plb at iotk.com
Tue Feb 8 07:42:42 EST 2005


All:

I am struggling with an import problem...

In my package, myapp, I have a module, logging.py.  That module,
naturally, imports the library module logging with an 'import logging'
statement.  However, when I use 'import myapp.logging' in my script,
the myapp.logging module tries to import itself rather than the library
logging module.

How can I prevent this from happening other than using a name that
doesn't conflict?

--PLB




More information about the Python-list mailing list