You are on page 1of 8

27/11/2015 Python IDE - w3resource

Python IDLE

Introduction

IDLE is an integrated development environment (an application like a word


processor which helps developers to write programs) for Python. IDLE is the
Python IDE which comes with Python, built with the tkinter GUI toolkit. It has two
modes Interactive and Development.

IDLE features :
Cross Platform : Works on Unix and Windows.
Multi-window text editor with syntax highlighting and smart indent and other.
Python shell window with syntax highlighting.
Integrated debugger.
Coded in Python, using the tkinter GUI toolkit

Python IDLE : Interactive Mode

Let us assume that we've already installed Python (here we installed Python 3.2 on
a standard pc with windows 7 OS). Click on start button and find Python 3.2 tab in
installed programs.

Now clicking on Python 3.2 tab you can see the Python program development tool
named IDLE (Python GUI).

http://www.w3resource.com/python/python-ide.php 1/8
27/11/2015 Python IDE - w3resource

To start IDLE click on IDLE (Python GUI) icon, you will see a new window opens up
and the cursor is waiting beside '>>>' sign which is called command prompt.

This mode is called interactive mode as you can interact with IDLE directly, you
type something (single unit in programming language) and press enter key Python
will execute it, but you can not execute your entire program here. At command
prompt type copyright and press enter key Python executes the copyright
information.

http://www.w3resource.com/python/python-ide.php 2/8
27/11/2015 Python IDE - w3resource

Now Python is ready to read new command. Lets execute the following commands
one by one.

Command -1 : print("Hello World")


Command -2 : print("Hello World")

First command is correct and but second one has syntax error, here is the
response from Python.

Before go to Development mode see the details of


Python IDLE Menus
http://www.w3resource.com/python/python-ide.php 3/8
27/11/2015 Python IDE - w3resource

File Menu
New window : Create a new editing window. Shortcut key : Ctrl+N
Open : Open an existing file. Shortcut key : Ctrl+O
Recent Files : List of recent open files.
Open module : Open an existing module. Shortcut key : Alt+M
Class browser : Show classes and methods in current file. shortcut key : Alt+C
Path browser : Show sys.path directories, modules, classes and methods.
Save : Save current window to the associated file. Shortcut key : Ctrl+S
Save As : Save current window to new file, which becomes the associated file. Shortcut key :
Ctrl+shift+S
Save Copy As : Save current window to different file without changing the associated file. Shortcut key :
Alt+shift+S
Print window. Shortcut key : Ctrl+P
Close : Close current window (asks to save if unsaved). Shortcut key : Alt+F4
Exit : Close all windows and quit IDLE (asks to save if unsaved). Shortcut key : Ctrl+Q

Edit Menu
Undo : Undo last change to current window (max 1000 changes). Shortcut key : Ctrl+Z
Redo : Redo last undone change to current window. Shortcut key : Ctrl+shift+Z
Cut : Copy selection into system-wide clipboard; then delete selection. Shortcut key : Ctrl+X
Copy : Copy selection into system-wide clipboard. Shortcut key : Ctrl+C
Paste : Insert system-wide clipboard into window. Shortcut key : Ctrl+V
Select All: All Select the entire contents of the edit buffer. Shortcut key : Ctrl+A
Find... : Open a search dialog box with many options. Shortcut key : Ctrl+F
Find again : Repeat last search. Shortcut key : Ctrl+G
Find selection : Search for the string in the selection. Shortcut key : Ctrl+F3
Find in Files... : Open a search dialog box for searching files. Shortcut key : Alt+F3
Replace...: Open a search-and-replace dialog box. Shortcut key : Ctrl+H
Go to line : Ask for a line number and show that line. Shortcut key : Alt+G
Expand word : Expand the word you have typed to match another word in the same buffer; repeat to get
a different expansion
Show call tip. Shortcut key : Ctrl+backslash
Show surrounding parens. Shortcut key : Ctrl+0
Show completions. Shortcut key : Ctrl+space

Shell Menu
View Last Restart. Shortcut key : F6
Restart shell. Shortcut key : Ctrl+F6

Debug Menu
Go to file/line look around the insert point for a filename and line number, open the file, and show the
line.
Debugger
Stack viewer show the stack traceback of the last exception
Auto open stack viewer.

Options Menu
Configure IDLE

Windows Menu
Zoom height. Shortcut key : Alt+2
http://www.w3resource.com/python/python-ide.php 4/8
27/11/2015 Python IDE - w3resource

Python shell.

Help Menu
About IDLE.
IDLE Help.
Python Documents. Shortcut key : F1

Python IDLE : Development mode

At first, start with a new window.

Clicking on "New window" under file menu a new window will come. Type print
"Hello World" in the new window.

http://www.w3resource.com/python/python-ide.php 5/8
27/11/2015 Python IDE - w3resource

Let's save (Save command is located under the File menu) the file now. We save
the program as helloworld.py under E:/python-programs folder.

To run the program select Run menu.

Now click on Run Module or press F5 as shortcut key to see the result.

http://www.w3resource.com/python/python-ide.php 6/8
27/11/2015 Python IDE - w3resource

Python IDLE : Syntax and Shell Colors

Syntax Color Shell Color


Keywords Orange Console output Brown
Strings Green Stdout Blue
Comments Red Stderr Dark green
Definitions Blue Stdin Black

Python command line interface

There are some users who prefer command line intersection, rather than a GUI
interface. To go Python command line, click on Python 3.2 tab then click on
Python(command line).

Here is the screen shot of Python command line interface. To return type exit() or
Ctrl+Z plus Enter key.
http://www.w3resource.com/python/python-ide.php 7/8
27/11/2015 Python IDE - w3resource

<<Previous Next>>

©w3resource 2011-15
Privacy policy
About
Contact
Feedback
Advertise

http://www.w3resource.com/python/python-ide.php 8/8

You might also like