
If you haven’t saved the file yet, when you click on “play” you will first be asked to give a location and name for saving the program into a file. You will see the result in the “Shell” panel just below. Click on “play” button to execute the file.Save the file (CTRL + S) and give it a name.Write your Python program in the text editor area.In this example, I’ve just run the same 2 lines I previously ran in the shell, but this time in the text editor. You want to be able to write longer programs, save them, execute them, reopen them, etc.

Running Python commands directly on the shell is of course not a viable solution for the mid/long term. Write complete Python programs on Thonny IDE Thonny IDE will recognize keywords (ex: import) and put a special font or color on them, so it becomes much more readable for you. Note: if you don’t have the “Shell” panel, or if you accidentally close it, you can reopen it by clicking on “View” > “Shell”.Īnd as you can see, you have syntax highlighting automatically done for you. In this example, when you run the command import time, there is no error because the Python module time (which is a core module by the way), is already installed and available for you to use. This is very handy if you want to quickly test a 2-3 lines program, or if you want to test if a Python module is already installed on your environment. Just write commands on the “Shell” panel to start executing Python code. But in Thonny IDE, nothing to do, the shell is already here. To do that you’ll need to open a special environment (named Python shell, or Python interpreter). Run Python commands on the shellĪs Python is an interpreted language, you can directly run Python commands one by one. Just click on Thonny Python IDE and you can start programming. You don’t need to configure anything related to Python. Once this is done, starting Thonny IDE is very simple.Ĭlick on the top left icon representing a raspberry > Programming > Thonny Python IDE.
Thonny run without saving how to#
Watch this video as an additional resource to this article:Īfter watching the video, subscribe to the Robotics Back-End Youtube channel so you don’t miss the next tutorials! How to start Thonny IDE on Raspberry Pi OSįirst, obviously, you need to install Raspberry Pi OS on a microSD card, for your Raspberry Pi board. Thonny IDE is already here ready to be used. Also, when you begin with programming, using an IDE is great because you don’t have to think about all the configuration, you can just start and learn step by step directly by programming.Īnd the icing on the cake: after you install Raspberry Pi OS, there is no extra step to do. The Thonny IDE will then allow you to be more productive when you write Python programs. So you can focus on writing code, which is the most important thing you can do.
Thonny run without saving code#

How to start Thonny IDE on Raspberry Pi OS.

What is an IDE, and what are the benefits you get from Thonny IDE on Raspberry Pi OS?.
