Find or install IDLE
Instructions checked 18 October 2026 against the official documentation linked below. Menu labels may differ between releases; verify the selected interpreter rather than relying only on its display name.
IDLE is Python’s Integrated Development and Learning Environment. It is an optional part of CPython, commonly included in python.org desktop installations. It needs Python and Tk support; it is not a separate bundled interpreter like some Thonny installers.
Look for IDLE in your Python applications, or launch it with the commands below. The interpreter used to launch idlelib is the interpreter IDLE uses. There is no need to find a VS Code-style interpreter dropdown.
Windows PowerShell
python -m idlelibmacOS/Linux terminal
python3 -m idlelibCreate a file, not just a shell entry
- The Shell window shows >>> and is useful for one-off Python expressions. Choose File → New File to open an editor window.
- Type print("Hello, Python!") without the >>> prompt. Save as hello.py inside python-practice.
- In the editor window choose Run → Run Module (usually F5; some keyboards require Fn+F5).
- Read Hello, Python! in the Shell window. Edit the message, save, and run again to see the change.
Check the runtime
Enter the diagnostic lines below in the Shell or in a saved script. They show the interpreter’s actual version and executable path. If you need another Python, close IDLE and launch that interpreter with -m idlelib.
For project packages, launch with the environment’s executable, provided its Python installation has Tk/IDLE support. Installation commands such as python -m pip belong in a terminal, not the IDLE Shell.
Python — IDLE Shell or script
import sys
print(sys.version)
print(sys.executable)Common problems
No module named idlelib or missing tkinter means the installation lacks optional components. On Ubuntu use python3-full or the distribution’s idle package; Fedora provides python3-idle. Check your distribution’s documentation.
If Run Module is missing, switch from the Shell to an editor window. If output does not change, save the correct file before rerunning.
IndentationError often comes from inconsistent indentation or copying prompt markers. Use four spaces per block and remove >>> from copied code. IDLE is a useful first editor, not a requirement for learning Python.
Syntax
print("Hello, Python!")Examples
Your first Python program
Save as hello.py in your project folder. Expected output: Hello, Python!
print("Hello, Python!")- print is a built-in function that writes to the output stream.
- The quoted text is a string. The quotes are not printed.
- Parentheses pass that string to print. No extra package is required.
Best practices
- Save your work before running it, and check the output after each small change.
- Keep your learning project in its own folder. Do not name files after standard modules such as random.py or json.py.
Runtime & versions
Python interpreter. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Python language reference