Pycharm notes

From raju

dummy

my favorite configuration

  • scrollbar -> right click -> Customize Highlighting Level -> drag it to Syntax
  • File -> Settings -> Editor -> General -> Editor Tabs -> Tab Closing Policy -> Tab limit - 20 -> OK

sort after

  • search for whole words - \bfoo\b


Ref:- https://www.jetbrains.com/help/pycharm/regular-expression-syntax-reference.html

useful shortcuts

  • To go back after control clicking
    • Ctrl+Alt+Left arrow, Ctrl+Alt+Right arrow - to go back and forward
    • Ctrl+Tab - Switch to the last (most recent) tab -- similar to how Alt+Tab works

Ref:- https://stackoverflow.com/questions/25103626/in-pycharm-how-to-go-back-to-last-location

tags | coming back after navigating to a function

  • Navigating between editor tabs
    • Open a file already opened in another tab - Ctrl+Tab
    • Go to the right or to the left tab - Alt+Right or Alt+Left
    • Go back and forth through the history of visited tabs - Ctrl+Alt+Left, Ctrl+Alt+Right


  • folding
    • Ctrl+Shift+Plus - open closed folds

links to the documentation

code reformatting

useful links

release history

released, version
2017-09-05, 2017.2.3
2017-08-23, 2017.2.2
2017-07-11, 2017.1.5

Ref:-

troubleshooting

Change PYTHONPATH

Run -> Edit configurations -> Environment variables -> click the three dots icon

Add something like

PYTHONPATH
c:\path\to\dir1;d:\path\to\dir2

Send output from a run to a file

Edit Configurations -> Logs tab -> check "Save console output to file" -> provide the full path of the output file.

This will redirect both standard output and standard error. On subsequent runs, it overwrites the previous file.

Ref:- https://stackoverflow.com/questions/21568810/how-do-i-redirect-input-and-output-with-pycharm-like-i-would-on-the-command-line

missing features

  • Pycharm does not correctly hightlight a multiline todo item inside the comments. It assumes that a todo item is always just a single line.

Ref:- https://stackoverflow.com/questions/48645942/how-do-i-format-a-multi-line-todo-comment-in-pycharm

go to a line

Use Ctrl+g

Tips

block selection

  • You can easily make column selection by dragging your mouse pointer while keeping the Alt key pressed.