- Python 3 is installed on this computer — your teacher has set this up. IDLE (Python's built-in editor) comes packaged with it automatically, so you don't install anything separately.
- You have your H drive (network storage) available — this is where you'll save your Python files so they're there next lesson, the same as your other schoolwork.
Setup steps
The Shell is for output and quick commands. The Editor is where your saved program belongs.
Open IDLE
IDLE is the program you'll use to write and run Python code throughout the SDD strand.
-
a
Click the Start button and search for IDLE, then click it to open. (It may be listed as "IDLE (Python 3.x)".)
-
b
A window opens with a coloured prompt
>>>— this is the Python Shell. It runs code one line at a time as you type it. You will not write your programs directly in here — see Step 2.
Open a new file — the Editor window
Your actual programs are written in a separate Editor window, not the Shell. Keeping these two windows straight is the single most common source of confusion when starting Python — the mockup below shows the difference.
-
a
In the Shell window's menu, click File › New File (or press Ctrl + N).
-
b
A second, blank window opens with no
>>>prompt. This is your Editor — this is where you type your program.
Save your file before running it
IDLE requires your file to be saved before it will run properly. Save to your H drive so your work is there next lesson.
-
a
With the Editor window active, click File › Save As (or press Ctrl + Shift + S).
-
b
Navigate to your H drive. Create (or open) a folder called Computing to keep your files organised.
-
c
Name the file
sdd0_test.py— the.pyending must stay exactly as it is. Click Save.
.py. If you change or remove this ending, IDLE won't recognise it as a Python program.
Write and run your first program
Now write one line of code in the Editor window and run it.
-
a
In the Editor window, type exactly:
print("Hello, World!")
-
b
Press F5, or click Run › Run Module from the Editor's menu.
-
c
IDLE will ask you to save again if you've made changes since Step 3 — click Yes.
-
d
Switch to look at the Shell window (not the Editor). You should see:
>>>
Hello, World! appeared in the Shell, your setup works. Your file is saved on your H drive and will be there next lesson — you can open it again with File › Open from IDLE.
Troubleshooting
>>> prompt in the Shell runs immediately but is not saved anywhere. Always write your program in the Editor window (Step 2) so you can save and reopen it.SyntaxError message in the Shellprint("Hello, World!") needs matching double quotes and both brackets. A single missing character is the most common cause.H:) in the Save As window's left-hand list. If it's missing, ask your teacher to check your login.