WxPython Ampersand Use

python, wxpython

Solution

The ampersand is to define a shortcut key. In your first example (i.e. "&File"), you can use 'Ctrl-F' to access the 'File' menu item

Problem

What is the point of using the ampersand in wxPython? I see it in almost all the tutorials. For instance, they use: ``` menubar.Append(fileMenu, '&File') ``` instead of: ``` menubar.Append(fileMenu, 'File') ``` What is the difference? Should I always use the ampersand for naming? Btw I found these examples from this famous wxPython Tutorial: http://zetcode.com/wxpython/menustoolbars/

Original source