Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pycharm - keep focus in editor when sending commands to python console

Same question as

Sypder 2 IDE - keep the focus in the editor after sending selected commands to interpreter

but for JetBrains PyCharm. Using option-shift-e on a mac, I can send commands to the python console, but I have to press esc to return focus to the editor. Can I do the Rstudio-style / Emacs-ESS style execution where focus stays in the editor window?

like image 767
daj Avatar asked Sep 27 '14 20:09

daj


People also ask

How do you give commands in PyCharm?

Press Alt+F12 to open terminal within PyCharm, then write in the command you wish to run and press enter.

How do I open the console in PyCharm?

You can assign a shortcut to open Python console: press Ctrl+Alt+S, navigate to Keymap, specify a shortcut for Main menu | Tools | Python or Debug Console. The main reason for using the Python console within PyCharm is to benefit from the main IDE features, such as code completion, code analysis, and quick fixes.

How do I run a python script in PyCharm?

Pycharm - Console. PyCharm has a full-fledged Python console with full code completion which is available in the option menu Tools -> Run Python Console. Now, let us run the code with the help of console to execute the script for getting the desired output, as shown below.

How to use context menu commands in Python?

Context menu commands Command Description Compare with Clipboard Show selection in the console and conten ... Pause Output Pause the Python script execution output Create Gist Choose this command to create a Git Gist ... Clear All Choose this item from the context menu t ...

How do I run a command in the Python console?

The line at caret loads into the Python console, and runs. By default, the Python console executes Python commands using the Python interpreter defined for the project. However, you can assign an alternative Python interpreter. In the Settings/Preferences dialog Ctrl+Alt+S, select Build, Execution, Deployment | Console | Python Console.


1 Answers

I'm using PyCharm 2.7.3 on Ubuntu 12.04 LTS with Netbeans keymap.

I can use CTRL+ALT+E to execute selected command and for the first time the console has a focus, indeed (first time after lauching IDE). However, any further CTRL+ALT+E leaves the focus on editor. (I can switch back to the console, which is named Run, using ALT+4.)

If newer versions of PyCharm are behaving differently then maybe it's a bug.

enter image description here

like image 54
rzymek Avatar answered Nov 15 '22 04:11

rzymek