IDLE editor

The Python IDLE (Integrated DeveLopment Environment) editor is a graphical user interface for Python development. This GUI is free and installed automatically during the Python installation. It enables you to edit, run, and debug Python programs in a simple GUI environment.

IDLE is actually a Python program that uses the standard library’s tkinter GUI toolkit to build its windows. It is portable and can be run on all major platforms, such as Windows, Linux, Mac OS, etc. It supports the following features:

  • command history and syntax colorization
  • auto-indent and unindent for Python code
  • word auto-completion
  • support for multiple windows
  • integrated debugger

The Python IDLE is usually present as an entry in the Start button menu in Windows 7. In Windows 8 and higher versions, you can start it by typing IDLE from the Start menu. Once started, it will display some useful information about the Python version and the operating system:

python shell

You can write your code after the >>> prompt and it will be executed when you press Enter:

python idle example

Although the shell window is useful for executing one-line commands, you will not use it to write full-fledged programs. Instead, Python IDLE comes with its own built-in text editor that you can use to write and save your code. You can start the editor by selecting File > New File:

python idle new file

This opens up a window where you can type your code:

python code

Before running your code, you will need to save it in a file (File > Save). Make sure that the file has the .py extension:

save python code idle

To run your code, click Run > Run Module (or press F5):

run python code idle

The result will be printed in the IDLE shell window:

run python code idle shell

Notice how the result of our program was displayed after the RESTART line.


Python IDLE is usually used by novice programmers. Later in your programming career, you will probably work with more powerful and robust tools, such as PyCharm, Eclipse or Komodo.
Geek University 2022