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 10:14:44 EST 2005


Good call!  The following snippet solved my problems portably.

path = sys.path[1:]
file, filename, description = imp.find_module('logging', path)
logging = imp.load_module('logging', file, filename, description)

Thanks!

--Peter




More information about the Python-list mailing list