How can a module find its own module object?
Michael Hudson
mwh at python.net
Sun Dec 23 16:58:42 EST 2001
More information about the Python-list mailing list
Sun Dec 23 16:58:42 EST 2001
- Previous message (by thread): How can a module find its own module object?
- Next message (by thread): How can a module find its own module object?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Oren Tirosh <oren-py-l at hishome.net> writes: > 'import myname' is not exactly a reliable way to get your own module > object - the file may be renamed, placed in a package, affected by > case-sensitivity problems, loaded from somewhere not in the path, etc. > > Is there any other way for a module to find itself other than searching > sys.modules for a module whose __dict__ is globals()? What's wrong with __file__? Cheers, M.
- Previous message (by thread): How can a module find its own module object?
- Next message (by thread): How can a module find its own module object?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list