blob: ff786c53f36b49ad4251dc718c6359a12180a414 [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
3Click on the dotted line at the top of a menu to "tear it off": a
4separate window containing the menu is created.
5
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +00006File Menu:
David Scherer7aced172000-08-15 01:13:23 +00007
Terry Jan Reedy8a0b7752013-07-01 00:42:52 -04008 New File -- Create a new file editing window
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +00009 Open... -- Open an existing file
10 Recent Files... -- Open a list of recent files
11 Open Module... -- Open an existing module (searches sys.path)
12 Class Browser -- Show classes and methods in current file
13 Path Browser -- Show sys.path directories, modules, classes
14 and methods
David Scherer7aced172000-08-15 01:13:23 +000015 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000016 Save -- Save current window to the associated file (unsaved
17 windows have a * before and after the window title)
David Scherer7aced172000-08-15 01:13:23 +000018
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000019 Save As... -- Save current window to new file, which becomes
20 the associated file
21 Save Copy As... -- Save current window to different file
22 without changing the associated file
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000023 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000024 Print Window -- Print the current window
David Scherer7aced172000-08-15 01:13:23 +000025 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000026 Close -- Close current window (asks to save if unsaved)
27 Exit -- Close all windows, quit (asks to save if unsaved)
David Scherer7aced172000-08-15 01:13:23 +000028
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000029Edit Menu:
David Scherer7aced172000-08-15 01:13:23 +000030
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000031 Undo -- Undo last change to current window
32 (A maximum of 1000 changes may be undone)
33 Redo -- Redo last undone change to current window
David Scherer7aced172000-08-15 01:13:23 +000034 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000035 Cut -- Copy a selection into system-wide clipboard,
36 then delete the selection
37 Copy -- Copy selection into system-wide clipboard
38 Paste -- Insert system-wide clipboard into window
39 Select All -- Select the entire contents of the edit buffer
David Scherer7aced172000-08-15 01:13:23 +000040 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000041 Find... -- Open a search dialog box with many options
42 Find Again -- Repeat last search
43 Find Selection -- Search for the string in the selection
David Scherer7aced172000-08-15 01:13:23 +000044 Find in Files... -- Open a search dialog box for searching files
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000045 Replace... -- Open a search-and-replace dialog box
46 Go to Line -- Ask for a line number and show that line
Thomas Wouterscf297e42007-02-23 15:07:44 +000047 Show Calltip -- Open a small window with function param hints
48 Show Completions -- Open a scroll window allowing selection keywords
49 and attributes. (see '*TIPS*', below)
50 Show Parens -- Highlight the surrounding parenthesis
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000051 Expand Word -- Expand the word you have typed to match another
52 word in the same buffer; repeat to get a
53 different expansion
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000054
55Format Menu (only in Edit window):
56
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000057 Indent Region -- Shift selected lines right 4 spaces
58 Dedent Region -- Shift selected lines left 4 spaces
59 Comment Out Region -- Insert ## in front of selected lines
60 Uncomment Region -- Remove leading # or ## from selected lines
61 Tabify Region -- Turns *leading* stretches of spaces into tabs
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +000062 (Note: We recommend using 4 space blocks to indent Python code.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000063 Untabify Region -- Turn *all* tabs into the right number of spaces
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000064 New Indent Width... -- Open dialog to change indent width
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000065 Format Paragraph -- Reformat the current blank-line-separated
66 paragraph
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000067
68Run Menu (only in Edit window):
69
70 Python Shell -- Open or wake up the Python shell window
David Scherer7aced172000-08-15 01:13:23 +000071 ---
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000072 Check Module -- Run a syntax check on the module
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000073 Run Module -- Execute the current file in the __main__ namespace
David Scherer7aced172000-08-15 01:13:23 +000074
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000075Shell Menu (only in Shell window):
76
77 View Last Restart -- Scroll the shell window to the last restart
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000078 Restart Shell -- Restart the interpreter with a fresh environment
79
80Debug Menu (only in Shell window):
81
82 Go to File/Line -- look around the insert point for a filename
Ned Deily2778d0d2012-10-20 13:25:34 -070083 and line number, open the file, and show the line
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000084 Debugger (toggle) -- Run commands in the shell under the debugger
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000085 Stack Viewer -- Show the stack traceback of the last exception
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000086 Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
87
88Options Menu:
David Scherer7aced172000-08-15 01:13:23 +000089
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000090 Configure IDLE -- Open a configuration dialog. Fonts, indentation,
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000091 keybindings, and color themes may be altered.
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +000092 Startup Preferences may be set, and Additional Help
Ronald Oussorene9f8bf02009-01-02 13:10:34 +000093 Sources can be specified.
94
Ned Deily2778d0d2012-10-20 13:25:34 -070095 On OS X this menu is not present, use
Ronald Oussorene9f8bf02009-01-02 13:10:34 +000096 menu 'IDLE -> Preferences...' instead.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000097 ---
Kurt B. Kaiserd00587a2004-04-24 03:08:13 +000098 Code Context -- Open a pane at the top of the edit window which
99 shows the block context of the section of code
100 which is scrolling off the top or the window.
Thomas Wouterscf297e42007-02-23 15:07:44 +0000101 (Not present in Shell window.)
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000102
103Windows Menu:
104
105 Zoom Height -- toggles the window between configured size
David Scherer7aced172000-08-15 01:13:23 +0000106 and maximum height.
107 ---
108 The rest of this menu lists the names of all open windows;
109 select one to bring it to the foreground (deiconifying it if
110 necessary).
111
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000112Help Menu:
113
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000114 About IDLE -- Version, copyright, license, credits
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000115 IDLE Readme -- Background discussion and change details
116 ---
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000117 IDLE Help -- Display this file
118 Python Docs -- Access local Python documentation, if
119 installed. Otherwise, access www.python.org.
120 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000121 (Additional Help Sources may be added here)
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000122
Andrew Svetlovd1837672012-11-01 22:41:19 +0200123Edit context menu (Right-click / Control-click on OS X in Edit window):
Ned Deily2778d0d2012-10-20 13:25:34 -0700124
Andrew Svetlovd1837672012-11-01 22:41:19 +0200125 Cut -- Copy a selection into system-wide clipboard,
126 then delete the selection
127 Copy -- Copy selection into system-wide clipboard
128 Paste -- Insert system-wide clipboard into window
Ned Deily2778d0d2012-10-20 13:25:34 -0700129 Set Breakpoint -- Sets a breakpoint (when debugger open)
130 Clear Breakpoint -- Clears the breakpoint on that line
131
Andrew Svetlovd1837672012-11-01 22:41:19 +0200132Shell context menu (Right-click / Control-click on OS X in Shell window):
Ned Deily2778d0d2012-10-20 13:25:34 -0700133
Andrew Svetlovd1837672012-11-01 22:41:19 +0200134 Cut -- Copy a selection into system-wide clipboard,
135 then delete the selection
136 Copy -- Copy selection into system-wide clipboard
137 Paste -- Insert system-wide clipboard into window
138 ---
139 Go to file/line -- Same as in Debug menu
Ned Deily2778d0d2012-10-20 13:25:34 -0700140
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000141
142** TIPS **
143==========
144
145Additional Help Sources:
146
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000147 Windows users can Google on zopeshelf.chm to access Zope help files in
148 the Windows help format. The Additional Help Sources feature of the
149 configuration GUI supports .chm, along with any other filetypes
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000150 supported by your browser. Supply a Menu Item title, and enter the
151 location in the Help File Path slot of the New Help Source dialog. Use
152 http:// and/or www. to identify external URLs, or download the file and
153 browse for its path on your machine using the Browse button.
154
155 All users can access the extensive sources of help, including
156 tutorials, available at www.python.org/doc. Selected URLs can be added
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000157 or removed from the Help menu at any time using Configure IDLE.
David Scherer7aced172000-08-15 01:13:23 +0000158
159Basic editing and navigation:
160
Kurt B. Kaiserdf506ea2005-06-12 04:33:30 +0000161 Backspace deletes char to the left; DEL deletes char to the right.
162 Control-backspace deletes word left, Control-DEL deletes word right.
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000163 Arrow keys and Page Up/Down move around.
164 Control-left/right Arrow moves by words in a strange but useful way.
165 Home/End go to begin/end of line.
166 Control-Home/End go to begin/end of file.
Thomas Wouterscf297e42007-02-23 15:07:44 +0000167 Some useful Emacs bindings are inherited from Tcl/Tk:
168 Control-a beginning of line
169 Control-e end of line
170 Control-k kill line (but doesn't put it in clipboard)
171 Control-l center window around the insertion point
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000172 Standard Windows bindings may work on that platform.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000173 Keybindings are selected in the Settings Dialog, look there.
David Scherer7aced172000-08-15 01:13:23 +0000174
175Automatic indentation:
176
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000177 After a block-opening statement, the next line is indented by 4 spaces
178 (in the Python Shell window by one tab). After certain keywords
179 (break, return etc.) the next line is dedented. In leading
180 indentation, Backspace deletes up to 4 spaces if they are there. Tab
181 inserts spaces (in the Python Shell window one tab), number depends on
182 Indent Width. (N.B. Currently tabs are restricted to four spaces due
183 to Tcl/Tk issues.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000184
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000185 See also the indent/dedent region commands in the edit menu.
David Scherer7aced172000-08-15 01:13:23 +0000186
Thomas Wouterscf297e42007-02-23 15:07:44 +0000187Completions:
188
189 Completions are supplied for functions, classes, and attributes of
190 classes, both built-in and user-defined. Completions are also provided
191 for filenames.
192
193 The AutoCompleteWindow (ACW) will open after a predefined delay
194 (default is two seconds) after a '.' or (in a string) an os.sep is
195 typed. If after one of those characters (plus zero or more other
196 characters) you type a Tab the ACW will open immediately if a possible
197 continuation is found.
198
199 If there is only one possible completion for the characters entered, a
200 Tab will supply that completion without opening the ACW.
201
202 'Show Completions' will force open a completions window. In an empty
203 string, this will contain the files in the current directory. On a
204 blank line, it will contain the built-in and user-defined functions and
205 classes in the current name spaces, plus any modules imported. If some
206 characters have been entered, the ACW will attempt to be more specific.
207
208 If string of characters is typed, the ACW selection will jump to the
209 entry most closely matching those characters. Entering a Tab will cause
210 the longest non-ambiguous match to be entered in the Edit window or
211 Shell. Two Tabs in a row will supply the current ACW selection, as
212 will Return or a double click. Cursor keys, Page Up/Down, mouse
213 selection, and the scrollwheel all operate on the ACW.
214
215 'Hidden' attributes can be accessed by typing the beginning of hidden
216 name after a '.'. e.g. '_'. This allows access to modules with
217 '__all__' set, or to class-private attributes.
218
219 Completions and the 'Expand Word' facility can save a lot of typing!
220
221 Completions are currently limited to those in the namespaces. Names in
222 an Edit window which are not via __main__ or sys.modules will not be
223 found. Run the module once with your imports to correct this
224 situation. Note that IDLE itself places quite a few modules in
225 sys.modules, so much can be found by default, e.g. the re module.
226
227 If you don't like the ACW popping up unbidden, simply make the delay
228 longer or disable the extension. OTOH, you could make the delay zero.
229
230 You could also switch off the CallTips extension. (We will be adding
231 a delay to the call tip window.)
232
David Scherer7aced172000-08-15 01:13:23 +0000233Python Shell window:
234
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000235 Control-c interrupts executing command.
Roger Serwy643ea532013-04-17 00:22:50 -0500236 Control-d sends end-of-file; closes window if typed at >>> prompt.
David Scherer7aced172000-08-15 01:13:23 +0000237
238 Command history:
239
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000240 Alt-p retrieves previous command matching what you have typed.
241 Alt-n retrieves next.
Ned Deily2778d0d2012-10-20 13:25:34 -0700242 (These are Control-p, Control-n on OS X)
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000243 Return while cursor is on a previous command retrieves that command.
244 Expand word is also useful to reduce typing.
David Scherer7aced172000-08-15 01:13:23 +0000245
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000246 Syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000247
248 The coloring is applied in a background "thread", so you may
249 occasionally see uncolorized text. To change the color
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000250 scheme, use the Configure IDLE / Highlighting dialog.
David Scherer7aced172000-08-15 01:13:23 +0000251
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000252 Python default syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000253
254 Keywords orange
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000255 Builtins royal purple
David Scherer7aced172000-08-15 01:13:23 +0000256 Strings green
257 Comments red
258 Definitions blue
259
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000260 Shell default colors:
David Scherer7aced172000-08-15 01:13:23 +0000261
262 Console output brown
263 stdout blue
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000264 stderr red
David Scherer7aced172000-08-15 01:13:23 +0000265 stdin black
266
267Other preferences:
268
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000269 The font preferences, keybinding, and startup preferences can
270 be changed using the Settings dialog.
David Scherer7aced172000-08-15 01:13:23 +0000271
272Command line usage:
Thomas Wouterscf297e42007-02-23 15:07:44 +0000273
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000274 Enter idle -h at the command prompt to get a usage message.
Kurt B. Kaiser8f570a72003-05-15 18:52:51 +0000275
276Running without a subprocess:
277
278 If IDLE is started with the -n command line switch it will run in a
279 single process and will not create the subprocess which runs the RPC
280 Python execution server. This can be useful if Python cannot create
281 the subprocess or the RPC socket interface on your platform. However,
282 in this mode user code is not isolated from IDLE itself. Also, the
283 environment is not restarted when Run/Run Module (F5) is selected. If
284 your code has been modified, you must reload() the affected modules and
285 re-import any specific items (e.g. from foo import baz) if the changes
286 are to take effect. For these reasons, it is preferable to run IDLE
287 with the default subprocess if at all possible.
Thomas Wouterscf297e42007-02-23 15:07:44 +0000288
289Extensions:
290
291 IDLE contains an extension facility. See the beginning of
292 config-extensions.def in the idlelib directory for further information.
293 The default extensions are currently:
294
295 FormatParagraph
296 AutoExpand
297 ZoomHeight
298 ScriptBinding
299 CallTips
300 ParenMatch
301 AutoComplete
302 CodeContext