blob: eed89c07aacfd97e405e51e17523b68fc6f6e14b [file] [log] [blame]
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +00001[See the end of this file for ** TIPS ** on using IDLE !!]
David Scherer7aced172000-08-15 01:13:23 +00002
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +00003File Menu:
David Scherer7aced172000-08-15 01:13:23 +00004
Terry Jan Reedy44d8b112013-07-01 00:42:44 -04005 New File -- Create a new editing window
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +00006 Open... -- Open an existing file
7 Recent Files... -- Open a list of recent files
8 Open Module... -- Open an existing module (searches sys.path)
9 Class Browser -- Show classes and methods in current file
10 Path Browser -- Show sys.path directories, modules, classes
11 and methods
David Scherer7aced172000-08-15 01:13:23 +000012 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000013 Save -- Save current window to the associated file (unsaved
14 windows have a * before and after the window title)
David Scherer7aced172000-08-15 01:13:23 +000015
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000016 Save As... -- Save current window to new file, which becomes
17 the associated file
18 Save Copy As... -- Save current window to different file
19 without changing the associated file
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000020 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000021 Print Window -- Print the current window
David Scherer7aced172000-08-15 01:13:23 +000022 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000023 Close -- Close current window (asks to save if unsaved)
24 Exit -- Close all windows, quit (asks to save if unsaved)
David Scherer7aced172000-08-15 01:13:23 +000025
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000026Edit Menu:
David Scherer7aced172000-08-15 01:13:23 +000027
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000028 Undo -- Undo last change to current window
29 (A maximum of 1000 changes may be undone)
30 Redo -- Redo last undone change to current window
David Scherer7aced172000-08-15 01:13:23 +000031 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000032 Cut -- Copy a selection into system-wide clipboard,
33 then delete the selection
34 Copy -- Copy selection into system-wide clipboard
35 Paste -- Insert system-wide clipboard into window
36 Select All -- Select the entire contents of the edit buffer
David Scherer7aced172000-08-15 01:13:23 +000037 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000038 Find... -- Open a search dialog box with many options
39 Find Again -- Repeat last search
40 Find Selection -- Search for the string in the selection
David Scherer7aced172000-08-15 01:13:23 +000041 Find in Files... -- Open a search dialog box for searching files
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000042 Replace... -- Open a search-and-replace dialog box
43 Go to Line -- Ask for a line number and show that line
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +000044 Show Calltip -- Open a small window with function param hints
45 Show Completions -- Open a scroll window allowing selection keywords
46 and attributes. (see '*TIPS*', below)
47 Show Parens -- Highlight the surrounding parenthesis
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000048 Expand Word -- Expand the word you have typed to match another
49 word in the same buffer; repeat to get a
50 different expansion
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000051
52Format Menu (only in Edit window):
53
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000054 Indent Region -- Shift selected lines right 4 spaces
55 Dedent Region -- Shift selected lines left 4 spaces
56 Comment Out Region -- Insert ## in front of selected lines
57 Uncomment Region -- Remove leading # or ## from selected lines
58 Tabify Region -- Turns *leading* stretches of spaces into tabs
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +000059 (Note: We recommend using 4 space blocks to indent Python code.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000060 Untabify Region -- Turn *all* tabs into the right number of spaces
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000061 New Indent Width... -- Open dialog to change indent width
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000062 Format Paragraph -- Reformat the current blank-line-separated
63 paragraph
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000064
65Run Menu (only in Edit window):
66
67 Python Shell -- Open or wake up the Python shell window
David Scherer7aced172000-08-15 01:13:23 +000068 ---
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000069 Check Module -- Run a syntax check on the module
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000070 Run Module -- Execute the current file in the __main__ namespace
David Scherer7aced172000-08-15 01:13:23 +000071
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000072Shell Menu (only in Shell window):
73
74 View Last Restart -- Scroll the shell window to the last restart
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000075 Restart Shell -- Restart the interpreter with a fresh environment
76
77Debug Menu (only in Shell window):
78
79 Go to File/Line -- look around the insert point for a filename
Ned Deilyc859bd22012-10-20 13:23:25 -070080 and line number, open the file, and show the line
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000081 Debugger (toggle) -- Run commands in the shell under the debugger
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000082 Stack Viewer -- Show the stack traceback of the last exception
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000083 Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
84
85Options Menu:
David Scherer7aced172000-08-15 01:13:23 +000086
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000087 Configure IDLE -- Open a configuration dialog. Fonts, indentation,
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000088 keybindings, and color themes may be altered.
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +000089 Startup Preferences may be set, and Additional Help
Ned Deilyb2f949a2015-07-04 15:04:42 -070090 Sources can be specified. On OS X, open the
91 configuration dialog by selecting Preferences
92 in the application menu.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000093 ---
Kurt B. Kaiserd00587a2004-04-24 03:08:13 +000094 Code Context -- Open a pane at the top of the edit window which
95 shows the block context of the section of code
96 which is scrolling off the top or the window.
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +000097 (Not present in Shell window.)
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000098
Ned Deilyb5daa3d2015-01-17 21:03:41 -080099Window Menu:
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000100
101 Zoom Height -- toggles the window between configured size
David Scherer7aced172000-08-15 01:13:23 +0000102 and maximum height.
103 ---
104 The rest of this menu lists the names of all open windows;
105 select one to bring it to the foreground (deiconifying it if
106 necessary).
107
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000108Help Menu:
109
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000110 About IDLE -- Version, copyright, license, credits
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000111 IDLE Readme -- Background discussion and change details
112 ---
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000113 IDLE Help -- Display this file
114 Python Docs -- Access local Python documentation, if
115 installed. Otherwise, access www.python.org.
116 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000117 (Additional Help Sources may be added here)
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000118
Andrew Svetlov5018db72012-11-01 22:39:14 +0200119Edit context menu (Right-click / Control-click on OS X in Edit window):
Ned Deilyc859bd22012-10-20 13:23:25 -0700120
Andrew Svetlov5018db72012-11-01 22:39:14 +0200121 Cut -- Copy a selection into system-wide clipboard,
122 then delete the selection
123 Copy -- Copy selection into system-wide clipboard
124 Paste -- Insert system-wide clipboard into window
Ned Deilyc859bd22012-10-20 13:23:25 -0700125 Set Breakpoint -- Sets a breakpoint (when debugger open)
126 Clear Breakpoint -- Clears the breakpoint on that line
127
Andrew Svetlov5018db72012-11-01 22:39:14 +0200128Shell context menu (Right-click / Control-click on OS X in Shell window):
Ned Deilyc859bd22012-10-20 13:23:25 -0700129
Andrew Svetlov5018db72012-11-01 22:39:14 +0200130 Cut -- Copy a selection into system-wide clipboard,
131 then delete the selection
132 Copy -- Copy selection into system-wide clipboard
133 Paste -- Insert system-wide clipboard into window
134 ---
135 Go to file/line -- Same as in Debug menu
Ned Deilyc859bd22012-10-20 13:23:25 -0700136
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000137
138** TIPS **
139==========
140
141Additional Help Sources:
142
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000143 Windows users can Google on zopeshelf.chm to access Zope help files in
144 the Windows help format. The Additional Help Sources feature of the
145 configuration GUI supports .chm, along with any other filetypes
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000146 supported by your browser. Supply a Menu Item title, and enter the
147 location in the Help File Path slot of the New Help Source dialog. Use
148 http:// and/or www. to identify external URLs, or download the file and
149 browse for its path on your machine using the Browse button.
150
151 All users can access the extensive sources of help, including
152 tutorials, available at www.python.org/doc. Selected URLs can be added
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000153 or removed from the Help menu at any time using Configure IDLE.
David Scherer7aced172000-08-15 01:13:23 +0000154
155Basic editing and navigation:
156
Kurt B. Kaiserdf506ea2005-06-12 04:33:30 +0000157 Backspace deletes char to the left; DEL deletes char to the right.
158 Control-backspace deletes word left, Control-DEL deletes word right.
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000159 Arrow keys and Page Up/Down move around.
160 Control-left/right Arrow moves by words in a strange but useful way.
161 Home/End go to begin/end of line.
162 Control-Home/End go to begin/end of file.
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +0000163 Some useful Emacs bindings are inherited from Tcl/Tk:
164 Control-a beginning of line
165 Control-e end of line
166 Control-k kill line (but doesn't put it in clipboard)
167 Control-l center window around the insertion point
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000168 Standard Windows bindings may work on that platform.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000169 Keybindings are selected in the Settings Dialog, look there.
David Scherer7aced172000-08-15 01:13:23 +0000170
171Automatic indentation:
172
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000173 After a block-opening statement, the next line is indented by 4 spaces
174 (in the Python Shell window by one tab). After certain keywords
175 (break, return etc.) the next line is dedented. In leading
176 indentation, Backspace deletes up to 4 spaces if they are there. Tab
177 inserts spaces (in the Python Shell window one tab), number depends on
178 Indent Width. (N.B. Currently tabs are restricted to four spaces due
179 to Tcl/Tk issues.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000180
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000181 See also the indent/dedent region commands in the edit menu.
David Scherer7aced172000-08-15 01:13:23 +0000182
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +0000183Completions:
184
185 Completions are supplied for functions, classes, and attributes of
186 classes, both built-in and user-defined. Completions are also provided
187 for filenames.
188
189 The AutoCompleteWindow (ACW) will open after a predefined delay
190 (default is two seconds) after a '.' or (in a string) an os.sep is
191 typed. If after one of those characters (plus zero or more other
192 characters) you type a Tab the ACW will open immediately if a possible
193 continuation is found.
194
195 If there is only one possible completion for the characters entered, a
196 Tab will supply that completion without opening the ACW.
197
198 'Show Completions' will force open a completions window. In an empty
199 string, this will contain the files in the current directory. On a
200 blank line, it will contain the built-in and user-defined functions and
201 classes in the current name spaces, plus any modules imported. If some
202 characters have been entered, the ACW will attempt to be more specific.
203
204 If string of characters is typed, the ACW selection will jump to the
205 entry most closely matching those characters. Entering a Tab will cause
206 the longest non-ambiguous match to be entered in the Edit window or
207 Shell. Two Tabs in a row will supply the current ACW selection, as
208 will Return or a double click. Cursor keys, Page Up/Down, mouse
209 selection, and the scrollwheel all operate on the ACW.
210
211 'Hidden' attributes can be accessed by typing the beginning of hidden
212 name after a '.'. e.g. '_'. This allows access to modules with
213 '__all__' set, or to class-private attributes.
214
215 Completions and the 'Expand Word' facility can save a lot of typing!
216
217 Completions are currently limited to those in the namespaces. Names in
218 an Edit window which are not via __main__ or sys.modules will not be
219 found. Run the module once with your imports to correct this
220 situation. Note that IDLE itself places quite a few modules in
221 sys.modules, so much can be found by default, e.g. the re module.
222
223 If you don't like the ACW popping up unbidden, simply make the delay
224 longer or disable the extension. OTOH, you could make the delay zero.
225
226 You could also switch off the CallTips extension. (We will be adding
227 a delay to the call tip window.)
228
David Scherer7aced172000-08-15 01:13:23 +0000229Python Shell window:
230
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000231 Control-c interrupts executing command.
Roger Serwy90f8b232013-04-17 00:22:50 -0500232 Control-d sends end-of-file; closes window if typed at >>> prompt.
David Scherer7aced172000-08-15 01:13:23 +0000233
234 Command history:
235
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000236 Alt-p retrieves previous command matching what you have typed.
237 Alt-n retrieves next.
Ned Deilyc859bd22012-10-20 13:23:25 -0700238 (These are Control-p, Control-n on OS X)
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000239 Return while cursor is on a previous command retrieves that command.
240 Expand word is also useful to reduce typing.
David Scherer7aced172000-08-15 01:13:23 +0000241
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000242 Syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000243
244 The coloring is applied in a background "thread", so you may
245 occasionally see uncolorized text. To change the color
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000246 scheme, use the Configure IDLE / Highlighting dialog.
David Scherer7aced172000-08-15 01:13:23 +0000247
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000248 Python default syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000249
250 Keywords orange
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000251 Builtins royal purple
David Scherer7aced172000-08-15 01:13:23 +0000252 Strings green
253 Comments red
254 Definitions blue
255
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000256 Shell default colors:
David Scherer7aced172000-08-15 01:13:23 +0000257
258 Console output brown
259 stdout blue
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000260 stderr red
David Scherer7aced172000-08-15 01:13:23 +0000261 stdin black
262
263Other preferences:
264
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000265 The font preferences, keybinding, and startup preferences can
266 be changed using the Settings dialog.
David Scherer7aced172000-08-15 01:13:23 +0000267
268Command line usage:
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +0000269
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000270 Enter idle -h at the command prompt to get a usage message.
Kurt B. Kaiser8f570a72003-05-15 18:52:51 +0000271
272Running without a subprocess:
273
274 If IDLE is started with the -n command line switch it will run in a
275 single process and will not create the subprocess which runs the RPC
276 Python execution server. This can be useful if Python cannot create
277 the subprocess or the RPC socket interface on your platform. However,
278 in this mode user code is not isolated from IDLE itself. Also, the
279 environment is not restarted when Run/Run Module (F5) is selected. If
280 your code has been modified, you must reload() the affected modules and
281 re-import any specific items (e.g. from foo import baz) if the changes
282 are to take effect. For these reasons, it is preferable to run IDLE
283 with the default subprocess if at all possible.
Kurt B. Kaiser209de1f2007-02-08 22:58:18 +0000284
285Extensions:
286
287 IDLE contains an extension facility. See the beginning of
288 config-extensions.def in the idlelib directory for further information.
289 The default extensions are currently:
290
291 FormatParagraph
292 AutoExpand
293 ZoomHeight
294 ScriptBinding
295 CallTips
296 ParenMatch
297 AutoComplete
298 CodeContext