Q: scope of module functions

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


Hello all,

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

# i need "fct" and some other from module "UTILS"
from UTILS import *
fct()
# 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
fct_in_main()


Appreciation for any help

    Frank Sonnenburg, BioSolveIT GmbH, Sankt Augustin, Germany





More information about the Python-list mailing list