George Sotiropoulos
George Sotiropoulos

Reputation: 2123

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

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

Upvotes: 3

Views: 7091

Answers (2)

Jorge Thomas
Jorge Thomas

Reputation: 137

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.

Upvotes: 2

Charles Ying
Charles Ying

Reputation: 17

You can reset the shortcut for 'Execute selection in console' via 'File --> Settings --> Keymap --> Other --> Execute selection in console' (Pycharm 3.6.x)and change the shortcut or you can just search the existing shortcut in the search box and change it. I also got used to the shortcut offered by Rstudio, so I changed it to 'F9' which might cause some conflicts but worked well in terms of efficiency.

Upvotes: 1

Related Questions