Hello Thonny

Author

Clayton Cafiero

Published

2025-01-05

Hello World! using Thonny

  1. Launch Thonny

  2. The default view in Thonny has two panes arranged vertically. The upper pane is the editor; the lower pane is the shell. We will work in the upper pane.

  3. Notice that tab on the upper pane says <untitled>. This is because we haven’t saved our work and given our progam a name (yet).

  4. In that pane, type

print('Hello World!')

followed by a single return/enter. Make sure you enclose Hello World! within quotation marks. Make sure there’s an open and closing parenthesis.

Your Thonny window should look like this:

Figure 1: Hello World in Thonny (1)
  1. Now save your program. Click on the save icon as indicated. [1]
Figure 2: Hello World in Thonny (2)

Enter the name hello_world.py in the dialog box, and make a note of the location where your file will be saved (you may change this location if you like).

Figure 3: Hello World in Thonny (3)

Notice that we gave the file a name in all lower-case letters, with an underscore between words, and a .py extension. This is the convention in Python. Other languages may differ, but this is how we name Python files. All the programs you write for this course should follow this convention.

At this point, the save icon should be greyed (indicating that your file is saved), and the tab which earlier was labeled <untitled> now reads hello_world.py.

Figure 4: Hello World in Thonny (4)
  1. Now click on the run icon, to run your program.
Figure 5: Hello World in Thonny (5)

In the lower pane, you should see the result of running your program. It prints “Hello World!”

That’s it. You’ve written and run your first Python program in Thonny. Welcome to the club!

Copyright © 2023–2025 Clayton Cafiero

No generative AI was used in producing this material. This was written the old-fashioned way.