6 .. moduleauthor:: Guido van Rossum <guido@Python.org>
11 single: Integrated Development Environment
13 IDLE is the Python IDE built with the :mod:`Tkinter` GUI toolkit.
15 IDLE has the following features:
17 * coded in 100% pure Python, using the :mod:`Tkinter` GUI toolkit
19 * cross-platform: works on Windows and Unix (on Mac OS, there are currently
22 * multi-window text editor with multiple undo, Python colorizing and many other
23 features, e.g. smart indent and call tips
25 * Python shell window (a.k.a. interactive interpreter)
27 * debugger (not complete, but you can set breakpoints, view and step)
38 create a new editing window
44 open an existing module (searches sys.path)
47 show classes and methods in current file
50 show sys.path directories, modules, classes and methods
57 save current window to the associated file (unsaved windows have a \* before and
58 after the window title)
61 save current window to new file, which becomes the associated file
64 save current window to different file without changing the associated file
67 close current window (asks to save if unsaved)
70 close all windows and quit IDLE (asks to save if unsaved)
77 Undo last change to current window (max 1000 changes)
80 Redo last undone change to current window
83 Copy selection into system-wide clipboard; then delete selection
86 Copy selection into system-wide clipboard
89 Insert system-wide clipboard into window
92 Select the entire contents of the edit buffer
95 Open a search dialog box with many options
101 Search for the string in the selection
104 Open a search dialog box for searching files
107 Open a search-and-replace dialog box
110 Ask for a line number and show that line
113 Shift selected lines right 4 spaces
116 Shift selected lines left 4 spaces
119 Insert ## in front of selected lines
122 Remove leading # or ## from selected lines
125 Turns *leading* stretches of spaces into tabs
128 Turn *all* tabs into the right number of spaces
131 Expand the word you have typed to match another word in the same buffer; repeat
132 to get a different expansion
135 Reformat the current blank-line-separated paragraph
138 Import or reload the current module
141 Execute the current file in the __main__ namespace
144 single: Import module
152 toggles the window between normal size (24x80) and maximum height.
154 The rest of this menu lists the names of all open windows; select one to bring
155 it to the foreground (deiconifying it if necessary).
158 Debug menu (in the Python Shell window only)
159 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
162 look around the insert point for a filename and linenumber, open the file, and
166 show the stack traceback of the last exception
169 Run commands in the shell under the debugger
171 JIT Stack viewer toggle
172 Open stack viewer on traceback
179 Basic editing and navigation
180 ----------------------------
182 * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right
184 * Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around
186 * :kbd:`Home`/:kbd:`End` go to begin/end of line
188 * :kbd:`C-Home`/:kbd:`C-End` go to begin/end of file
190 * Some :program:`Emacs` bindings may also work, including :kbd:`C-B`,
191 :kbd:`C-P`, :kbd:`C-A`, :kbd:`C-E`, :kbd:`C-D`, :kbd:`C-L`
194 Automatic indentation
195 ^^^^^^^^^^^^^^^^^^^^^
197 After a block-opening statement, the next line is indented by 4 spaces (in the
198 Python Shell window by one tab). After certain keywords (break, return etc.)
199 the next line is dedented. In leading indentation, :kbd:`Backspace` deletes up
200 to 4 spaces if they are there. :kbd:`Tab` inserts 1-4 spaces (in the Python
201 Shell window one tab). See also the indent/dedent region commands in the edit
208 * :kbd:`C-C` interrupts executing command
210 * :kbd:`C-D` sends end-of-file; closes window if typed at a ``>>>`` prompt
212 * :kbd:`Alt-p` retrieves previous command matching what you have typed
214 * :kbd:`Alt-n` retrieves next
216 * :kbd:`Return` while on any previous command retrieves that command
218 * :kbd:`Alt-/` (Expand word) is also useful here
220 .. index:: single: indentation
226 The coloring is applied in a background "thread," so you may occasionally see
227 uncolorized text. To change the color scheme, edit the ``[Colors]`` section in
230 Python syntax colors:
262 idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
264 -c command run this command
266 -e edit mode; arguments are files to be edited
267 -s run $IDLESTARTUP or $PYTHONSTARTUP first
268 -t title set title of shell window
270 If there are arguments:
272 #. If :option:`-e` is used, arguments are files opened for editing and
273 ``sys.argv`` reflects the arguments passed to IDLE itself.
275 #. Otherwise, if :option:`-c` is used, all arguments are placed in
276 ``sys.argv[1:...]``, with ``sys.argv[0]`` set to ``'-c'``.
278 #. Otherwise, if neither :option:`-e` nor :option:`-c` is used, the first
279 argument is a script which is executed with the remaining arguments in
280 ``sys.argv[1:...]`` and ``sys.argv[0]`` set to the script name. If the script
281 name is '-', no script is executed but an interactive Python session is started;
282 the arguments are still available in ``sys.argv``.