don't understand namespaces...

Lawrence Hanser lhanser at gmail.com
Thu Apr 30 16:11:55 CEST 2009


Dear Pythoners,

I think I do not yet have a good understanding of namespaces.  Here is
what I have in broad outline form:

------------------------------------
import Tkinter

Class App(Frame)
      define two frames, buttons in one and Listbox in the other

Class App2(Frame)
      define one frame with a Text widget in it

root = Tk()
app = App(root)
win2 = Toplevel(root)
app2 = App2(win2)
root.mainloop()
------------------------------------

My understanding of the above goes like this:
1) create a root window
2) instantiate a class that defines a Frame in the root window
3) create another Toplevel window
4) instantiate another class that defines a frame in the Toplevel window (win2)

What I cannot figure out is how to reference a widget in app2 from app...

I hope this is sort of clear.

Any assistance appreciated.

Thanks,

Larry



More information about the Python-list mailing list