On Mar 11, 1:29 am, Timmie wrote:
> > Put this code at the end of your script:
> > import sys
> > info = [(module.__file__, name)
> > for (name, module) in sys.modules.iteritems()
> > if hasattr(module, '__file__')]
> > info.sort()
> > import pprint
> > pprint.p
En Tue, 10 Mar 2009 12:29:28 -0200, Timmie
escribió:
Put this code at the end of your script:
import sys
info = [(module.__file__, name)
for (name, module) in sys.modules.iteritems()
if hasattr(module, '__file__')]
info.sort()
import pprint
pprint.pprint(in
> Put this code at the end of your script:
> import sys
> info = [(module.__file__, name)
> for (name, module) in sys.modules.iteritems()
> if hasattr(module, '__file__')]
> info.sort()
> import pprint
> pprint.pprint(info)
>
> AFAIK unless someone has been mess
On Mar 10, 11:01 am, Tim Michelsen
wrote:
> Hello,
>
> how do I create a list of all modules imported by my module/script and
> which are present in the namespace?
>
> I am looking for something like %who in Ipython.
>
> My aim is to create a file for the documentation that shows all
> dependencie
mat...@gmail.com wrote:
for i in dir() :
> ... t = eval( 'type(' + i + ')' )
> ... if re.match('.*module.*',str(t)) : print i, t
> ...
If you think you need eval stop and think again. You don't.
If you think you need regular expressions stop and think again. You usually
don't.
>>> def
On Mar 10, 10:01 am, Tim Michelsen
wrote:
> Hello,
>
> how do I create a list of all modules imported by my module/script and
> which are present in the namespace?
>
> I am looking for something like %who in Ipython.
>
> My aim is to create a file for the documentation that shows all
> dependencie
Hello,
how do I create a list of all modules imported by my module/script and
which are present in the namespace?
I am looking for something like %who in Ipython.
My aim is to create a file for the documentation that shows all
dependencies of my script on external (3rd party) libraries.
T