Dictionaries in Python

Michael Powers (powers@dvts.com)
Tue, 23 Aug 1994 15:27:06 -0700

Jim,

Hi, I pulled up an old post regarding scope in Python that you had written.
My question is in simplified form:

FILE a.py LOOKS LIKE

yes = "yes"
no = "no"

from b import *

main()

FILE b.py LOOKS LIKE

def main():
print yes
print no

The problem is that yes and no are not found inside of the main function.
How do I share global variables between separate files?? In my case I am
trying to define classes and instances within different .py files that need
to refer to some central services that are instantiated within one central
file. I would rather not have to pass these as arguments to each method.
There IS a reason for this, trust me.

Michael