some import / namespace questions
Graham.Dumpleton at gmail.com
Thu Aug 9 02:34:24 CEST 2007
On Aug 9, 1:11 am, stef mientki <s.mien... at mailbox.kun.nl> wrote:
> I'm working on a rather strange program,
> that is partially build dynamically,
> and where users can create plugins,
> without knowing any of the details of the core program.
> Of course this leads to some weird bugs,
> so one of the things I want to view/log is the order (and even better
> the way) modules are imported.
Set and export the environment variable:
in your environment before you run Python. This will generate lots of
internal information about what Python is up to, including details
about module importing, where it is searching for modules etc etc. For
>>> import socket
python2.3/socket.pyc matches /System/Library/Frameworks/
import socket # precompiled from /System/Library/Frameworks/
import _socket # dynamically loaded from /System/Library/Frameworks/
import _ssl # dynamically loaded from /System/Library/Frameworks/
import errno # builtin
Output goes to standard error. There can be quite a lot, so you may
want to redirect standard error to a file.
More information about the Python-list