PyCharm

I still use PyCharm as my daily text editor.

IDEs like PyCharm have tons of features and the 80/20 rule applies: investing 20% effort learning the tool will get you 80% productivity. The rest is marginal gains and your effort is better spent thinking about your code.

Here, I'll enumerate the subset of functionality that I use.

Keyboard Shortcuts

  1. Cmd + O - Goto file or class
  2. Ctrl + G - Select the next matching text.
  3. Cmd + B - Jump to the definition or usages of a class, function, or variable.
  4. Cmd + X - Cut. Use this to delete a line of code.
  5. Cmd + C / Ctrl + V - Copy and paste
  6. Cmd + / - Toggle commenting.
  7. Tab / Shift + Tab - Increase or decrease the indentation level.
  8. Ctrl + R - Rerun the previous file, test, or command
  9. Ctrl + A - Jump to the start of the line
  10. Ctrl + E - Jump to the end of the line

GUI Features

You can use PyCharm to just edit text but that misses the point of an IDE.

  • Refactor. PyCharm handles renaming and moving seamlessly. You don't need to go and find every instance a class or function is imported and rename it. Just use the tool once and it'll "just work" everywhere.

  • Managing conda environments and keeping them sync with requirements.txt. PyCharm will warn you if a package is outdated. If so, in the terminal tab I'll run

conda activate py39 
pip install -r requirements.txt

I don't use PyCharm to manage Python environments.

  • Running tests. You can run directory or file or individual tests. Very handy with the debugger.

  • Run file in Python console. This runs the file and then leaves you with a Python prompt so you can interactively use the code you just wrote. I use IPython here.

  • Markdown. PyCharm can render markdown files. There's a new table editor so you don't have to mess around with the -- and | characters.

  • Git I don't recommend using PyCharm for most git actions but it has a handy rollback button, a neat diff viewer between branches, and a nice tool to fix merge conflicts.

  • Formatting. Don't bother making your code pretty. It can be any color you want as long as it's black.

black ../src-code-dir

Summary

What's the cost of this? The "Community Edition" is free and that's what I use. PyCharm Community Edition It's been around for a long time and I don't expect it to go anywhere.

links

social