Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run current line in Spyder 3.5( ctrl +f10 not working)

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

like image 379
Jim Avatar asked Aug 19 '16 05:08

Jim


People also ask

How do you run the current line on a Spyder?

The key to run the current line by itself is F9 . The shortcut ctrl+F10 is used if you are in debugging mode. You can see a list of shortcuts by selecting Preferences in the Tool menu, and then clicking on Keyboard shortcuts . In Spyder 3.3.

How do I run code in editor on Spyder?

To execute the program, select Run -> Run (or press F5), and confirm the Run settings if required. If so, then you have just run your first Python program - well done.


2 Answers

The key to run the current line by itself is F9. The shortcut ctrl+F10 is used if you are in debugging mode.

You can see a list of shortcuts by selecting Preferences in the Tool menu, and then clicking on Keyboard shortcuts.

like image 141
Jitse Niesen Avatar answered Sep 19 '22 15:09

Jitse Niesen


Coming from R studio I imagine you were hoping to have a command that runs the next command, rather than just that one row (which can break a command into several parts and cause errors).

The exact equivalent doesn't exist yet but if you get accustomed to adding #%% before and after chunks ("cells") you want to run together then you can use the following commands to run the whole chunk.

Run cell: Ctrl + Return
Run cell and advance : Shift+Return

like image 35
Kirk Geier Avatar answered Sep 22 '22 15:09

Kirk Geier