Tkinter Puzzler

Tim Daneliuk tundra at
Fri Jan 7 05:28:31 EST 2005

I am trying to initialize a menu in the following manner:

for entry in [("Up", KeyUpDir), ("Back", KeyBackDir), ("Home", KeyHomeDir), ("Startdir", KeyStartDir), ("Root", 

     func = entry[1][0], command=lambda: func(None))

However, at runtime, each of the menu options binds to the *last* function
named in the list (KeyStartDir).

Explicitly loading each entry on its own line works fine:


Any ideas why the first form does not fly?

Tim Daneliuk     tundra at
PGP Key:

More information about the Python-list mailing list