Introspect imports from module
Bastian Ballmann
bastian.ballmann at notch-interactive.com
Thu Jun 21 09:16:59 EDT 2012
Hi,
that's really great stuff! I love it! Thx :)
Am Thu, 21 Jun 2012 13:00:36 +0200
schrieb Christian Heimes <lists at cheimes.de>:
> Am 21.06.2012 10:03, schrieb Bastian Ballmann:
> > Any suggestions how I could just get the import of
> > module.to.inspect? Thanks && have a nice day!
>
> You could try a completely different approach and use the compiler
> package to inspect the abstract syntrax tree of a compiled module. The
> approach has the nice side effect that you don't have to import a
> module to inspect its imports. This script may serve as an example
> for you:
>
> http://svn.zope.org/Zope3/trunk/utilities/importchecker.py?rev=113742&view=auto
>
> Christian
>
--
Bastian Ballmann / Web Developer
Notch Interactive GmbH / Badenerstrasse 571 / 8048 Zürich
Phone Phone +41 44 297 17 17 / www.notch-interactive.com
CHECK OUR LATEST WORK: http://www.notch-interactive.com/projekte/
More information about the Python-list
mailing list