Mike Meyer wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>>> I have a fairly large project going on and would like to figure out
>>> automatically from the source which files are being imported.
>> If you use your own import function, like below, you could create a
>> list of all import
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>> I have a fairly large project going on and would like to figure out
>> automatically from the source which files are being imported.
> If you use your own import function, like below, you could create a
> list of all imported modules.
Why not use
If you use your own import function, like below, you could create a
list of all imported modules.
#!/usr/bin/env python
mod_list = []
def my_import(name, globals = None, locals = None, fromlist = None):
mod_list.append(name)
mod = __import__(name, globals, locals, fromlist)
return mo