I have been working my way through a Python 3 book and got to the chapter on tkinter. The following is a segment of a example program that works:

# the views
frame = tkinter.Frame(window)
frame.pack()
button = tkinter.Button(frame, text='Up', command=click_up)
button.pack()
button = tkinter.Button(frame, text='Down', command=click_down)
button.pack()
label = tkinter.Label(frame, textvariable=counter)
label.pack()

when I first looked at it I thought it would not work, thinking that the second reference to button = would over write the first one. Obviously that is wrong because the program does work. Could someone explain to me why it works?

Regards,  Jim

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to