Q: scope of module functions

Frank Sonnenburg sonnenbu at informatik.uni-bonn.de
Sat Jun 8 19:16:02 CEST 2002

Hello all,

a little tricky problem (at least from my point of view); given module

# i need "fct" and some other from module "UTILS"
from UTILS import *
# END of module CALLER

Now, inside fct(), how do i determine the module - in this case CALLER -
from where fct() was called?

Even concerning cases like (continuation of example):

# Now we are in __main__
import CALLER
fct_in_main = CALLER.fct

Appreciation for any help

    Frank Sonnenburg, BioSolveIT GmbH, Sankt Augustin, Germany

More information about the Python-list mailing list