Open file in the editor, and select a fragment of code to be executed.
On the context menu of the selection, choose Execute selection in console, or
press Shift+Alt+EShift+Alt+EShift+Alt+EShift+Alt+EShift+Alt+EShift+Alt+ECtrl+Alt+ECtrl+Alt+EShift Alt EShift Alt EShift Alt E.
With no selection, the command changes to Execute line in console. Choose this command on the context menu, or press same keyboard shortcut.
The line at caret loads into the Python console, and runs.