Running a Python program in Linux is as simple as executing the Python file in the terminal.
But that’s not very convenient for everyone and it doesn’t help you debug your programs. too raw.
There are several IDEs and text editors that can be used for Python development. The PyCharm community edition is available for Linux users.
I recently came across another IDE specifically crafted for Python beginners. I liked the idea of this application and hence I am sharing it with you here.
Thonny is a cross-platform, open source Python IDE for beginners
Thonny feels like the Python version of Eclipse in terms of UI and UX. And that’s not entirely a bad thing considering most C++ and Java beginners start with Eclipse and many stay with it afterward.
It’s not a new tool. It has been on the horizon for some years now. I don’t code in Python so I never discovered it until recently.
Dedicated to Python, Thonny has features that help Python beginners understand how their program behaves. Let’s take a look at those features.
Plug and play
Thonny comes with Python so you don’t need to do additional effort for installing Python. That’s not a big deal for Linux users as most distributions have Python installed by default.
The interface is simple. It gives you an editor where you can write your Python program and hit the Run button or use F5 key to play the program. The output is displayed at the bottom.
See variables
From the View-Variables, you can see the values of all the variables. No need to print them all.
Built-in debugger
Run your program step by step by using the debugger. You can access it from the top menu or use the Ctrl+F5 keys. You don’t even need the breakpoints here. You can go into big steps with F6 or in small steps with F7.
In small steps, you can see how Python sees your expressions. This is very helpful for new programmers to understand why their program is behaving in a certain manner.
That’s not it. For function calls, it opens a new window with separate local variables table and code pointer. Super cool!
Syntax error highlighter
Beginners often make simple syntax errors like missing paranthesis, quotes etc. Thonny is points it out immediately in the editor itself.
Local variables are also visually distinguished from globals.
Auto completion
You don’t have to type everything. Thonny supports auto code completion which helps in coding faster.
Access to system shell
From the Tools, you can access the system shell. From here you can install the new Python package or learn to handle Python from the command line.
Please note that if you use Flatpak or Snap, Thonny may not be able to access the system shell.
Manage Pip from GUI
Go to Tools and Manage packages. It opens a window and you can install Pip packages from this GUI.
Good enough features for learning Python, right? Let’s see how to