global variables

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Oct 3 02:53:09 EDT 2007


Colin J. Williams a écrit :
> 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:
>>
>>
>>
>> #!/usr/bin/env python
>>
>> from Tkinter import *
>>
>> def resize(ev=None):
>>       label.config(font='Helvetica -%d bold' % \
>>           scale.get())
>>
>>
(snip code binding label and scale)
> 
> label and scale are instances.

And ? *Everything* you can bind to a name is an instance.




More information about the Python-list mailing list