name of client module

Jeff Schwab jeff at schwabcenter.com
Tue Feb 19 01:43:03 CET 2008


Q1: When a module is imported, is there any way for the module to 
determine the name of the client code's module?

Q2: My understanding is that the code in a module is executed only on 
the first import of that module.  Is there any way to have a hook 
invoked on subsequent imports, and for that hook (as in Q1) to determine 
the name of the client module?



More information about the Python-list mailing list