Issue 2188: Documentation hint about disabling proxy detection.
[python.git] / Doc / library / idle.rst
blob8209aa961c1b8176bee5af28512145df7fbc779d
1 .. _idle:
3 IDLE
4 ====
6 .. moduleauthor:: Guido van Rossum <guido@Python.org>
8 .. index::
9    single: IDLE
10    single: Python Editor
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
20   problems with Tcl/Tk)
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)
30 Menus
31 -----
34 File menu
35 ^^^^^^^^^
37 New window
38    create a new editing window
40 Open...
41    open an existing file
43 Open module...
44    open an existing module (searches sys.path)
46 Class browser
47    show classes and methods in current file
49 Path browser
50    show sys.path directories, modules, classes and methods
52 .. index::
53    single: Class browser
54    single: Path browser
56 Save
57    save current window to the associated file (unsaved windows have a \* before and
58    after the window title)
60 Save As...
61    save current window to new file, which becomes the associated file
63 Save Copy As...
64    save current window to different file without changing the associated file
66 Close
67    close current window (asks to save if unsaved)
69 Exit
70    close all windows and quit IDLE (asks to save if unsaved)
73 Edit menu
74 ^^^^^^^^^
76 Undo
77    Undo last change to current window (max 1000 changes)
79 Redo
80    Redo last undone change to current window
82 Cut
83    Copy selection into system-wide clipboard; then delete selection
85 Copy
86    Copy selection into system-wide clipboard
88 Paste
89    Insert system-wide clipboard into window
91 Select All
92    Select the entire contents of the edit buffer
94 Find...
95    Open a search dialog box with many options
97 Find again
98    Repeat last search
100 Find selection
101    Search for the string in the selection
103 Find in Files...
104    Open a search dialog box for searching files
106 Replace...
107    Open a search-and-replace dialog box
109 Go to line
110    Ask for a line number and show that line
112 Indent region
113    Shift selected lines right 4 spaces
115 Dedent region
116    Shift selected lines left 4 spaces
118 Comment out region
119    Insert ## in front of selected lines
121 Uncomment region
122    Remove leading # or ## from selected lines
124 Tabify region
125    Turns *leading* stretches of spaces into tabs
127 Untabify region
128    Turn *all* tabs into the right number of spaces
130 Expand word
131    Expand the word you have typed to match another word in the same buffer; repeat
132    to get a different expansion
134 Format Paragraph
135    Reformat the current blank-line-separated paragraph
137 Import module
138    Import or reload the current module
140 Run script
141    Execute the current file in the __main__ namespace
143 .. index::
144    single: Import module
145    single: Run script
148 Windows menu
149 ^^^^^^^^^^^^
151 Zoom Height
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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161 Go to file/line
162    look around the insert point for a filename and linenumber, open the file, and
163    show the line.
165 Open stack viewer
166    show the stack traceback of the last exception
168 Debugger toggle
169    Run commands in the shell under the debugger
171 JIT Stack viewer toggle
172    Open stack viewer on traceback
174 .. index::
175    single: stack viewer
176    single: debugger
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
202 menu.
205 Python Shell window
206 ^^^^^^^^^^^^^^^^^^^
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
223 Syntax colors
224 -------------
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
228 :file:`config.txt`.
230 Python syntax colors:
231    Keywords
232       orange
234    Strings 
235       green
237    Comments
238       red
240    Definitions
241       blue
243 Shell colors:
244    Console output
245       brown
247    stdout
248       blue
250    stderr
251       dark green
253    stdin
254       black
257 Command line usage
258 ^^^^^^^^^^^^^^^^^^
262    idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
264    -c command  run this command
265    -d          enable debugger
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``.