Beginner Level
Intermediate Level
Python for Networking

1.5 Meet IDLE: Python’s Interactive Development Environment

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.

What IDLE is for

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.

A first test: print and a missing quote

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.

Opening IDLE on each system

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.

Key takeaways

  • IDLE is Python’s interactive development environment: it runs one line at a time so you can test syntax immediately.
  • print(‘hello’) prints hello; a missing closing quote gives an “EOL while scanning string literal” syntax error.
  • Open IDLE from Start on Windows, from Finder → Applications → Python 3 on macOS, or with python3 or idle in an Ubuntu terminal.
  • Keep your editor and the interpreter open side by side: write in the editor, test lines in IDLE.

Watch the video lesson

Note: the presenter’s on-screen search through the Ubuntu applications menu for IDLE was skipped; the guide gives the working commands only.