global variables
Steven Bethard
steven.bethard at gmail.com
Tue Oct 2 19:28:16 EDT 2007
More information about the Python-list mailing list
Tue Oct 2 19:28:16 EDT 2007
- Previous message (by thread): global variables
- Next message (by thread): global variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
TheFlyingDutchman wrote: > Does anyone know how the variables label and scale are recognized > without a global statement or parameter, in the function resize() in > this code: [snip] > def resize(ev=None): > label.config(font='Helvetica -%d bold' % \ > scale.get()) You're just calling a method on the "label" object. Python looks in the function local namespace and doesn't see a "label" object, so it steps up to the global namespace. There is a "label" object in the global namespace so it uses that one. STeVe
- Previous message (by thread): global variables
- Next message (by thread): global variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list