In PyCharm 2018.2.5 (Community Edition), I have bound a keyboard shortcut to "Run File in Console". This launches opens the console and runs the file, but does not focus the console for input and anything I type goes into my code. (Sometimes when I use the switcher to focus the Python console it will try to search console variables when I type.)
Is there a way to automatically focus the Python console for input when it is launched?
No for PyCharm there is no way to automatically focus the Python console for input when it is launched.
In Notepad ++ i can do the following.
So the step between writing the code and executing it to see what it does exactly one hotkey. Its not one hotkey and a mouse click or what ever no.... its exactly one press of a button. This makes learning very effective because there are no detours.
I looked long in PyCHarm but i could not find this functionality or a workaround. So the answer to your question is "With PyCharm this is not possible."
Here is how to do it in Notepad ++.
Create the "save and run in python" macro: In NppExec create a script as shown here:
NPP_CONSOLE 0
npp_save
npp_run cmd /K C:\Python27\python.exe "$(FULL_CURRENT_PATH)"
Another editor that offers you this quick and direct run functionality is "Atom" with its many plugins.
The shortcut to switch between the code and console is Alt+4
; by clicking on the console or using this shortcut, future consoles you open will be selected by the input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With