On 1/8/21 4:47 PM, Rich Shepard wrote:
> I'm using Chapter 9 in Mark Roseman's "Modern Tkinter for Busy Python
> Developers" to learn how to write a top level menu. MWE code is attached.
>
> Python3 tells me there's invalid syntax on line 42:
>     self.['menu'] = menubar # attach it to the top level window
>          ^
> yet that's the syntax he prints on page 84 (and has in the book's code
> supplement).
>
> Why am I getting an invalid syntax error here?
>
> TIA,
>
> Rich 


Because it is the wrong syntax.

It could be either:

self.menu = menubar

or

self['menu'] = menubar

-- 
Richard Damon

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to