For example, in this screenshot,
I would like to find out what command is called by clicking on Python->Execute statement.
The keyboard combination C-h k
can be used to obtain information about functions linked to certain menu items or other keys. In the context of this question, entering C-h k
and then clicking on the menu item will display the name of the function and additional helpful information (e.g., the doc string sometimes can be very useful).
C-h k
and then click on the menu item.