Run Scripts With Thonny
Thonny is useful for running your scripts as well as creating them, so here you’re going to see how to run a basic script. Here’s a script you can save as first.py
:
print('Hello World!')
You can click the button with the arrow in the circle or press F5 to run the script. In the bottom windown, which is the shell, you’ll see a command to run first.py
along with the script’s output.
00:00 Running Scripts. Obviously, Thonny is useful for running your scripts as well as creating them. So here, we’re going to see how to run a basic script.
00:14
Here is the simple, traditional “Hello, World!” saved as first.py
. This will be the first new button, Run current script, which is also F5 on your keyboard. You click that, and as you can see in the bottom window, in the shell, we have the command to run first.py
and then we have its output, which is just highlighted there.
00:37 We can do that again by clicking the button as many times as we like, and as you can see, each time we get the same output. If you want to clear the shell window, you can either right-click or double-finger-tap, depending on if you’re on a Mac or not, and clear that window, because sometimes you want to make sure you’re seeing the output from your last run of the program.
Become a Member to join the conversation.