Hello IDLE
Hello World! using IDLE
Launch IDLE
The default view in IDLE is a window for Python shell, so to create a new Python file, you’ll need to use the IDLE menu.
Select “New File” from the “File” menu.

This will open a new editor window, so you should see something like this:

- In that window, enter the following Python code:
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 IDLE editor window should look like this.

- Now save your file. Select File | Save As… from the IDLE menu.

- When the dialog box opens, enter the file name
hello_world.py
, and make a note of the location where your file will be saved (you may change this location if you like). Click “Save”.

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.
- Now your file is saved. To run your file, select “Run | Run Module…” from the IDLE menu.

When your program runs, IDLE should bring the shell window to the front. The result should look like this.

That’s it. You’ve written and run your first Python program in IDLE. 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.