Alt + Shift + E shortcut in pycharm, how to execute two connected lines of code with one key stroke

Viewed 4956

Let's say that I have the following simple code in pycharm editor.

dataframe = [1 , 12, 2,1 ,21,3 ,21,312,1 ,1,1 , 12, 2,1 ,21,3 ,
21,312,1 ,1, 2121]

in order to execute them, I have to select both lines (highlight them) and then press the keys Alt + Shift + E.

I am wondering if there is any other way, or settings to execute both lines without selecting them, but just press the key combination when the cursor is in one of the two lines, as it happens in R

2 Answers

With PyCharm Community 2020.1, navigate to Settings/Keymaps there is a magnifier icon "Find Action by Shortcut"; hit shif + alt + E and you'll see under the folder <Plug-ins/Python Community Edition/> the action called "Execute Selection in Python Console"; change it to ctrl + enter and that'll do.

Related