"Premshree Pillai" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 28 Dec 2004 19:34:36 GMT, It's me <[EMAIL PROTECTED]> wrote: > > This must be another newbie gotchas. > > > > Consider the following silly code, let say I have the following in file1.py: > > > > #============= > > import file2 > > global myBaseClass > > myBaseClass = file2.BaseClass() > > myBaseClass.AddChild(file2.NextClass()) > > #============= > > You have declared myBaseClass to be global, but it doesn't exist. >
No, myBaseClass exists in file1.py. The question is how can I tell file2.py that the global variable is in file1 (without doing a silly file1.myBaseClass.... Since I am invoking file2 from file1, I would have thought that global variables in file1 exists automatically....(too much C thinking, I know) -- http://mail.python.org/mailman/listinfo/python-list