What Is Python IDLE? A Guide to IDLE and the REPL

What Python’s built-in IDLE is, how to open it on Windows, macOS and Linux, how it differs from the REPL, and when to move on to a different editor.

IDLE is the small editor and interactive shell that comes with Python. Its name stands for Integrated Development and Learning Environment, and the Python documentation describes it as a cross-platform environment that works mostly the same on Windows, Unix and macOS. It is a good place to type your first lines of Python, and a poor place to stay once your projects grow.

This guide covers what IDLE is, how to open it on each platform, how to use its shell and editor, how it differs from the plain Python prompt (the REPL), and when to move on. IDLE facts come from the official Python documentation for version 3.15, and the REPL behaviour was tested on Python 3.12 and 3.13.

IDLE at a glance

What it is A Python shell, a text editor and a basic debugger in one program
Who it suits People writing their first scripts, and anyone who wants zero setup
What it is built with Python and Tk, in the idlelib package of the standard library
Start it anywhere python -m idlelib
Does it cost anything No, it is part of Python
When to move on When you want project folders, a stronger debugger, linting or git inside the editor

What IDLE is made of

The Python documentation lists the main features:

  • A Python shell window with colour for the code you type, the output and error messages.
  • A multi-window text editor with multiple undo, Python syntax colouring, smart indent, call tips and auto completion.
  • Search within any window, replace within editor windows, and search through multiple files (grep).
  • A debugger with persistent breakpoints, stepping, and viewing of global and local namespaces.
  • Configuration dialogs, browsers and other tools.

IDLE is implemented in the idlelib package of the standard library, which is why the command to start it is python -m idlelib. The documentation notes that IDLE is an optional module, so it is missing from some installations.

How to open IDLE

On any system, run it from a terminal:

python -m idlelib

On Windows you can use py -m idlelib. The documentation also lists options for the command, such as -e to open an editor window, -i to open a shell window, -r file to run a file in the shell and -d to enable the debugger. A file name after the options opens that file in an editor.

On Windows, the standard installer has an option named “Install Tcl/Tk support and IDLE”, and another that creates shortcuts for IDLE if it is installed. If you installed Python that way, py -m idlelib is the command that always works. The embeddable Python package does not include Tcl/Tk or IDLE. For the different ways to install Python on Windows, see Python on Windows.

On macOS, the Python documentation says the Python folder inside your Applications folder contains IDLE, “the development environment that is a standard part of official Python distributions”, alongside the Python Launcher.

On Linux, IDLE is sometimes a separate package. Python’s own documentation gives these commands for when it is not included:

sudo apt update && sudo apt install idle       # Debian and Ubuntu
sudo dnf install python3-idle                  # Fedora, RHEL, CentOS
sudo zypper install python3-idle               # SUSE and openSUSE
sudo apk add python3-idle                      # Alpine

If IDLE will not start

IDLE needs a Python built with Tk. On a Homebrew-installed Python 3.15.2 on macOS, running python -m idlelib printed “IDLE can’t import Tkinter. Your Python may not be configured for Tk” instead of opening a window. The same command with a uv-managed Python 3.13, which includes Tk, worked. If you see that message, install Python from python.org, install your distribution’s IDLE package, or use a Python build that includes Tk. See Python virtual environments explained if you manage several interpreters.

The two windows: Shell and Editor

IDLE has two kinds of window, and they have different menus. On Windows and Linux each window has its own menu bar. On macOS there is one application menu that changes with the active window.

The Shell window

The Shell is where you type Python and see results immediately. According to the documentation:

  • Press Return with the cursor anywhere on a line to run a single-line statement.
  • For a multi-line statement such as a for loop, finish it with a blank line.
  • A line containing RESTART means the user execution process has been restarted, which happens when you run a file from the editor.
  • Ctrl-C attempts to interrupt a running statement, but it may fail.
  • Ctrl-D at a >>> prompt closes the Shell.
  • Alt-P and Alt-N (Ctrl-P and Ctrl-N on macOS) bring back the previous and next matching statement from your history.
  • Very long output is squeezed into a “Squeezed text” label once it passes a line limit, which is 50 lines by default.

The Editor window

Use File > New File to open an editor window and write a script. The editor colours keywords, built-in names, strings and comments, and it helps with indentation:

  • Smart indent: after a block-opening statement the next line is indented four spaces, and after keywords such as break and return it is dedented. Backspace in leading whitespace deletes up to four spaces.
  • Completions: typing . after a module or class name opens a completion box after a delay of two seconds by default, which you can change. You can also open it with Ctrl-Space, and pressing Tab after a prefix usually does the same.
  • Call tips: typing ( after the name of an accessible function shows its signature and the start of its docstring.
  • Code Context (in the Options menu) keeps the opening lines of blocks such as def and class visible as you scroll, and Show Line Numbers is off by default.

Running a script

Save your file, then choose Run > Run Module or press F5. The documentation says IDLE checks the module, and if there is no error it restarts the shell to clean the environment, executes the module and shows the output in the Shell window. A syntax error stops the run before it starts. Afterwards the Shell stays open with your script’s variables defined, so you can type result or call a function by hand to inspect what happened, which is one of IDLE’s most useful teaching features.

Run > Run… Customized does the same with settings: command-line arguments are added to sys.argv. Run > Check Module only checks syntax.

The debugger

Turn it on with Debug > Debugger in the Shell window. Once it is on, code entered in the Shell or run from an Editor runs under the debugger. You can set breakpoints from the context menu in an editor window, and the Stack Viewer shows the traceback of the last exception with access to locals and globals. Breakpoints only have an effect when running under the debugger, and they are saved in your .idlerc directory.

The Python documentation describes this feature as “still incomplete and somewhat experimental”, which is a fair summary: it is enough to step through a short script, and weaker than the debuggers in VS Code or PyCharm.

Configuring IDLE

Options > Configure IDLE (Preferences in the application menu on macOS) changes fonts, indentation, keybindings, colour themes, the startup windows and size, and extensions. IDLE keeps its settings in a .idlerc directory in your home folder, and the documentation advises never editing those files by hand: use the dialog.

What IDLE can’t do

The documentation lists some real limits worth knowing:

  • Your code runs in a separate process from IDLE, so a script that reads the keyboard or screen directly will not behave as it does in a normal terminal.
  • A file named like a standard library module breaks things. A common cause of failure is a user-written file with the same name as a standard library module, such as random.py or tkinter.py.
  • Imports in the editor have no effect until you run the file, so completions for a module you just imported work only after a run.
  • The Shell never throws away output, so a program that prints without end will eventually fill memory.
  • Display is limited to characters in the Basic Multilingual Plane.

IDLE also has no project or folder view, no built-in git support and no linting, and it does not create virtual environments for you.

IDLE versus the REPL

The REPL, short for read-eval-print loop, is the interactive prompt you get by typing python (or py on Windows) in a terminal. IDLE’s Shell does the same job inside a window. The practical differences:

REPL in a terminal IDLE
How you start it python or py python -m idlelib, or an app icon
Editing a script You use another editor Built-in editor with F5 to run
Multi-line input Continuation prompts (...) Blank line ends the block
History Arrow keys, plus F2 in 3.13 and later Alt-P and Alt-N
Exit exit() or quit(), or Ctrl-D (Unix) and Ctrl-Z (Windows) Close the window, or Ctrl-D at a prompt
Needs Tk No Yes

Using the REPL

Type python (or python3, or py on Windows; see python vs python3 vs py for which to use) and you get the >>> prompt. To leave, Python’s tutorial says to type an end-of-file character, which is Control-D on Unix and Control-Z on Windows, or to run quit().

One convenience for calculations: in interactive mode, the last printed expression is assigned to the variable _. This session was run on Python 3.13:

>>> 2 + 2
4
>>> _ * 10
40

What changed in Python 3.13

Python 3.13 introduced a new interactive shell, based on code from the PyPy project. According to the 3.13 release notes, when you start it from an interactive terminal it supports:

  • Multi-line editing with history preservation.
  • The commands help, exit and quit without parentheses.
  • Colour in prompts and tracebacks by default.
  • F1 for interactive help browsing, F2 for history browsing that skips output and the prompts, and F3 for paste mode, which makes pasting larger blocks easier (press F3 again to return).

You can see the difference. On Python 3.12, typing exit on its own prints “Use exit() or Ctrl-D (i.e. EOF) to exit” and keeps going. On 3.13, typing exit on its own quits, and typing help opens the help system straight away. To go back to the old shell, set the PYTHON_BASIC_REPL environment variable. Colour can be turned off with NO_COLOR, or by setting TERM to dumb.

IDLE’s shell is separate from this: it has its own colouring and history, whatever version of Python it runs.

When to move on from IDLE

IDLE is enough for your first scripts and for following a beginner course. Move to another editor when you:

  • Keep several files open as a project, or work with folders and git.
  • Need linting, a type checker or formatting as you type; the Python tooling stack for 2026 shows what a modern setup looks like.
  • Want a stronger debugger than IDLE’s experimental one.
  • Work with data and notebooks.

Good next steps: Thonny if you want a learner-focused editor with step-through evaluation, free alternatives to VS Code if cost or weight is the concern, or the best Python IDE for data science if you work with data. If you only want to try Python without installing anything, see the best online Python compilers and IDEs.

Frequently Asked Questions

What is Python IDLE?

IDLE is Python’s Integrated Development and Learning Environment. It comes from the Python project itself and gives you a shell window for typing Python interactively, an editor window for writing scripts, and a basic debugger, all in one program.

How do I open IDLE?

On any system you can run python -m idlelib in a terminal. On macOS, IDLE is in the Python folder inside Applications. On Debian and Ubuntu Linux you may first need to install it with sudo apt install idle. The Windows installer has an option to include it.

What is the difference between IDLE and the Python REPL?

The REPL is the interactive prompt you get by running python in a terminal. IDLE contains an interactive shell that behaves like the REPL, plus a text editor with syntax highlighting and a debugger. The REPL is a way to run Python; IDLE is a program built around it.

Is IDLE good enough for learning Python?

Yes for first lessons. It needs no setup beyond Python itself and has an editor, a shell and a debugger. Its own documentation describes the debugger as incomplete and somewhat experimental, so many learners move to a fuller editor once they are comfortable.

Why does IDLE say it cannot import Tkinter?

IDLE is built on Tk, so it needs a Python with Tk support. Some Python builds, for example a Homebrew build tested on macOS, ship without it. Use a python.org installer, install your distribution’s IDLE package on Linux, or use a Python build that includes Tk.