Tkinter problem

Benny Rochwerger (brochwer@legent.com)
Wed, 18 Jan 95 11:04:20 EST

While translating some code from Tcl/Tk to python/tkinter I've found a
piece of code I can't figure out how to write in python. In particular:

foreach i {1 2 3 4 5} {
button .$i -text "$i" -command "puts $i"
pack .$i -side left
}

In this code I use information available at the time the buttons
are created ($i), that won't be available when the button is pushed
if I wanted to used a callback (like I think I have to in
python).

Any suggestions ?

Thanks in advance,

Benny