PyCharm Professional — Python Editors in Review 👩‍💻

See what money can give you 🤑

Martin Thoma
Oct 26 · 6 min read
Image for post
Image for post
PyCharm Professional 2020.2. The screenshot was taken by Martin Thoma.

PyCharm is an IDE developed by JetBrains since 2010. Yes, the same company that developed IntelliJ, the de-facto default for Java. It costs $200 per year which is pretty expensive if you just get your feet wet with Python. It’s pretty cheap if you consider that the editor/IDE is one of the most important tools of a professional software developer.

It is used by many Python developers as one can see in the number of StackOverflow questions (12,455), in the 2019 Jetbrains Survey, and the 2019 StackOverflow survey.

Speed

It takes roughly 9 seconds on my ThinkPad T490s to start. Sublime Text takes less than a second. PyCharm also has this annoying “do you really want to close me” pop-up. When you close it, it automatically saves the document — but the edit history will be gone. This means you cannot to Ctrl+Z to undo edits.

When you create a new file, you have to decide first which type it has, which name it has, and where it should be stored. In Sublime Text, you just start typing.

The User Interface

In the screenshot above you can see how PyCharm typically looks for me. As PyCharm allows quite a bit of customization, you have to say it like this. Let’s go through the components of the UI:

  • The editor dominates the view. It supports syntax highlighting, shows the line numbers in the gutter, and the scroll bar indicates where it found warnings (yellow) and errors (red).
  • To the left of the editor, there is a file explorer.
  • To the right of the editor, there are two minimized elements that are pretty cool: A database explorer and the SciView. We will come to those later.
  • In the footer, there are also minimized elements. I like the problems and the terminal section.

Find Action

Find Action allows you to search for any menu. No more searching in deeply nested menus. It is similar to the Command Palette in Sublime Text.

If you have the Sublime Text key bindings, you can open the dialogue with Ctrl+Shift+P . It looks like this:

Image for post
Image for post
The screenshot was taken by Martin Thoma

In contrast to Sublime Text, PyCharm does not do a fuzzy search here.

Key bindings: Customizable Shortcuts!

If you go to File → Settings ( Ctrl+Alt+S ) and then to Keymap, you can select the defaults of other editors like Sublime Text. This makes a switch pretty easy. You also have a nice interface to set key bindings.

Tab Interactions

You can close a tab with Ctrl+W , create a new file with Ctrl+N , select the previous/next tab with Ctrl+Page Down / Ctrl+Page up . I haven’t found a way to jump to the first/second/n-th tab.

Jump to Line

Ctrl+G lets you go to a line. You can even specify the column you want to go to!

Goto File

Ctrl+P lets you go to any file in the workspace. No fuzzy search, though 😢

Find / Replace All

Ctrl+F to find something, Ctrl+H to replace. You can also use RegEx! Definitely a feature I don’t want to miss. This is pretty cool in combination with multiple cursors!

Image for post
Image for post
The screenshot was taken by the author.

Distraction-Free Mode and Zen Mode

Shift+F11 switches in distraction-free mode. You just see the code. No mini-map, no file explorer, no footer. This is helpful if you want to show another developer something. The Zen mode is even better 😃

Autocompletion

The autocompletion of PyCharm works well. PyCharm obviously makes use of type annotations 🎉

Image for post
Image for post
PyCharm automatically suggests using one of the attributes of the used class. The screenshot was taken by the author.

PyCharm also gives you hints when you create a new class or use a function:

Image for post
Image for post
PyCharm tells you that there are two parameters — x and y — expected. It also lets you know that you have to enter the first one now (x is bold) and that it should be a float 😍

Jump to Definition

F12 shows you the usage of the symbol under your cursor and brings you to the declaration of classes, methods, and functions. In contrast to Sublime Text, this works flawlessly in PyCharm.

Debugging

PyCharm comes with a proper debugger. Have a look at the following image:

Image for post
Image for post
The debugger of PyCharm. Screenshot was taken by Martin Thoma.

You can set a breakpoint at the line you’re interested in by clicking next to it (1). Then you click on the “debug” icon (2). PyCharm opens a variable explorer (3). Now you can decide if you want to step over / step into / step into my code / step out (4). It’s simple to use, but extremely valuable if you don’t have a clue what is going on.

Plugins

PyCharm comes has a Marketplace that offers 2354 plugins. For Python, I like Rainbow Brackets: If you have multiple brackets after each other, it becomes hard to read them. Rainbow brackets colors the matching brackets to support you.

Please let me know if you have any other plugin you use for Python!

Code Inspection

PyCharm has various linters that don’t have a comparable free static code analysis tool. They call this code inspection.

Image for post
Image for post
Code Inpsection within PyCharm.

Cool rules I’ve noticed are:

  • Spell checking: This works astonishingly well. Preventing typos is helpful because you don’t want to force downstream users to have to add typos e.g. if your function name was wrong.
  • Documentation: PyCharm can check your docstrings against the function signature. This is pretty amazing 😻

In my example repository mpu I had a couple of those. This is a repository where I try hard to follow good practices.

Database Explorer

The database tool window is a part of PyCharm where I don’t know yet what to think about it. One the one hand, it is useful. On the other hand, I like the Unix philosophy:

Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new “features”.

There are a couple of programs which fulfil the same purpose:

  • phpMyAdmin: For MySQL / MariaDB only
  • SQLite Browser: For SQLite only
  • Heidi SQL: MySQL, MariaDB, PostgreSQL, SQLite, Microsoft SQL Server
  • DBeaver: All databases which have a JDBC or ODBC driver, including MySQL, PostgreSQL, SQLite
  • Jetbrains DataGrip: Pretty much the same as the plugin, I suspect?

SciView

The Scientific View is essentially trying to offer the capabilities of a Jupyter Notebook within PyCharm.

More details can be found here:

42 more hints

PyCharm can do a lot. Way more than I can show you in this 6 minute article. Give the following video a try:

Comparison: Community Edition and Sublime Text

PyCharms community edition editor is pretty crappy. Don’t even give it a try.

In comparison to Sublime Text, one has to mention the big price difference. You can use Sublime Text pretty well for free. Even if you are super annoyed by the reminder to pay for it, it still is only $70 once for Sublime Text compared to $200 per year for PyCharm.

Sublime Text offers what you need in 90% of your development time. In those cases, it is faster and less cluttered. However, especially the missing debugger might be a deal-breaker for you.

Summary

PyCharm Professional is an amazing IDE for professional Python developers. I love that they have nice autocompletion, can jump to definitions, and have a working spell-checker integrated. The debugger is also sometimes super helpful.

On the downside, PyCharms interface is too cluttered. To me, the editor has too little screen space. The context menus are just crazy huge and the starting time is too long if you just want to edit a small file.

What’s next?

In this “Python for Beginners” series, we already explained how to use Python with WSL2 on Windows, how to use Python on Windows with Anaconda. The editor Sublime Text was introduced as a good minimal starting point.

This article briefly introduced PyCharm Professional. In a follow-up articles, you will see Visual Studio Code. Stay tuned!

Python In Plain English

Go deeper with the language powering everything.

Martin Thoma

Written by

I’m a Software Engineer with focus on Data Science, Machine Learning. I have over 10 years of experience with Python. https://www.linkedin.com/in/martin-thoma/

Python In Plain English

Go deeper with the language powering everything.

Martin Thoma

Written by

I’m a Software Engineer with focus on Data Science, Machine Learning. I have over 10 years of experience with Python. https://www.linkedin.com/in/martin-thoma/

Python In Plain English

Go deeper with the language powering everything.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store