name of client module

Jeff Schwab jeff at schwabcenter.com
Mon Feb 18 19:43:03 EST 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