In this video, you will learn what IDLE is, how to open it on Windows, macOS, and Ubuntu, and how testing one line at a time helps you find errors fast.
IDLE is Python’s interactive development environment — the Python 3 interpreter. Its main job is helping you with errors. Imagine writing a program in a text editor such as Notepad, dozens of pages long, and getting an error without knowing where it is or what is wrong. IDLE lets you execute a single line at a time, so you can see whether that line itself has a problem before hunting through the whole program.
The print function prints whatever you type inside its brackets on the screen. Type print(‘hello’) — with the word in single quotes — and hello prints to the screen, confirming the function works and the syntax is correct. But type print(‘hello) and forget the closing quote, and you get “EOL while scanning string literal” — a syntax error, meaning something is coded wrong. IDLE shows you where the problem is, even though error messages can sometimes be a little vague; here, the missing single quote is the whole story.
On Windows, go to Start, type IDLE, and open the IDLE for your Python 3 version, 32-bit or 64-bit. On macOS, open Finder, click Applications, then Python 3, then IDLE. On Ubuntu, type python3 in the terminal to open the interpreter, or run IDLE from the terminal — on the presenter’s machine the idle3 command was not found, but plain idle worked and looked exactly the same. In practice you will usually have both open while coding: a text editor to write the program, and the interpreter to test single lines and check the syntax as you go.
Note: the presenter’s on-screen search through the Ubuntu applications menu for IDLE was skipped; the guide gives the working commands only.