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 Enter.
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.