How to run the current line in Spyder 3.5 (ctrl + f10 does not work)

I am very new to Python and I'm used to R-studio, so I choose Spyder. On the Spyder layout, I saw the "run current line (ctrl + f10)" button. But this does not work by pressing the button or c + 10. Am I missing something? I can only select a script and 'ctrl + enter' to run the current line, which is not at all convenient. I am using ubuntu with Anaconda distribution.

+20
source share
5 answers

The key to start the current line is F9 . The shortcut ctrl+F10 used if you are in debug mode.

You can see the list of shortcuts by choosing Preferences from the Tool menu and then clicking Keyboard shortcuts .

+39
source

Based on R studio, I assume that you were hoping to get a command that runs the next command, and not just one line (which can split the command into several parts and cause errors).

The exact equivalent does not yet exist, but if you are used to adding # %% before and after the fragments ( "cells" ) that you want to run together, then you can use the following commands to start the entire fragment.

Run cell: Ctrl + Return
Launch a cell and move forward: Shift + Return

+11
source

Some keyboards have different layouts in terms of what the keys should do. For me, running occurs if done through Fn + F9 .

+1
source

F9 is the key that does the job for you. To reproduce the RStudio style, go to " Preferences on the Tools menu, select Keyboard Shortcuts .

Since Ctrl + Enter assigned to another function, change it first. Then assign the value Ctrl + Enter F9 Ctrl + Enter . Now Spyder is the same as RStudio. At least on the way.

0
source

Control Enter is a quick way to execute a line or block of code in R Studio and Python.

In Spyder, make sure the line or block is selected before pressing Ctrl-Enter

0
source

All Articles