Tkinter menu item underline syntax [RESOLVED]

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Wed Jan 6 15:03:50 EST 2021


On 2021-01-06 at 11:18:15 -0800,
Rich Shepard <rshepard at appl-ecosys.com> wrote:

> On Wed, 6 Jan 2021, 2QdxY4RzWzUUiLuE at potatochowder.com wrote:
> 
> > I'm not a TKinter expert (nor even a current user), but that line that
> > begins with whitespace and "command =" looks suspicious. As far as I can
> > see, Python is correct to call it syntactically erroneous.
> 
> Yes, the line above it needed to be terminated by a comma, not \n.
> 
> I found the answer: underline is an option and options are key: value pairs.
> So, the correct syntax is underline: 0.

Glad you found it.  :-)

For the sake of future generations who may run into this issue, can you
post the complete, correct call to file_menu.add_command?


More information about the Python-list mailing list