Problem in designing a global directory in python

Serge Orlov Serge.Orlov at gmail.com
Wed Mar 30 04:11:57 EST 2005


Tian wrote:
> I have tried using "sysctx=None" instead of "global sysctx", but it
> doesn't work either.
> It seems my initialization work in the previous calling of init() has
> no persistent effect when "utils" is imported using "from
> myproj.utils import getContext".
>
> What's weird, when a module is in the same directory as utils.py,
> where I can simply use "utils" for importing, there is no such
> problem.
>
> Any other suggestions?

put the following print statement next to every "global sysctx"
replacing ... with the function name where the statement is located.

print "... globals are in %s" % __name__

  Serge.




More information about the Python-list mailing list