johnf wrote:
> Thanks Paul - I'll play with this.
> Just to be sure I understand:
> Somewhere in the:
> app.MainFormClass = "custfrm1.cdxml"
> app.setup()
>
> the namespace gets changed and the global namespace of "main" is no longer
> available. Right?
No, well, maybe partway true, but the fact that you are asking it in
this fashion means you don't understand namespaces in Python. Forget
about global and local for now. Take this example:
class MyTest(object):
# The following names are attributes in the MyTest namespace:
test_var1 = "hi"
test_var2 = 23
def myFunc(self):
# We are now in myFunc's namespace.
# The method can't just do:
# print test_var1
# because it doesn't exist in this namespace
Ah, classes are just a specialized form of nested namespaces.
It isn't that main's namespace is no longer available, because it is
available, from within main. I could keep on talking but I think it
would only confuse things more at this point.
> As I currently understand namespace there are only
> three - built-ins, global and local. So it is possible to over ride the
> global. IOW the Forms are a separate program to "main ". Right?
There are as many namespaces as there are Python structures.
def myFunc():
pass
There. I created a namespace.
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev