Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(63)

Side by Side Diff: Lib/idlelib/help.txt

Issue 5066: IDLE documentation for Unix obsolete/incorrect
Patch Set: Created 7 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« Doc/library/idle.rst ('K') | « Doc/library/idle.rst ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 [See the end of this file for ** TIPS ** on using IDLE !!] 1 [See the end of this file for ** TIPS ** on using IDLE !!]
2 2
3 Click on the dotted line at the top of a menu to "tear it off": a 3 IDLE is the Python IDE built with the tkinter GUI toolkit.
4 separate window containing the menu is created.
5 4
6 File Menu: 5 IDLE has the following features:
6 -coded in 100% pure Python, using the tkinter GUI toolkit
7 -cross-platform: works on Windows, Unix, and OS X
8 -multi-window text editor with multiple undo, Python colorizing and many other
9 features, e.g. smart indent and call tips
10 -Python shell window (a.k.a interactive interpreter)
11 -debugger (not complete, but yes can set breakpoints, view and step)
12
13 Menus:
14
15 IDLE has two window types the Shell window and the Editor window. It is
16 possible to have multiple editor windows simultaneously. IDLE's
17 menus dynamically change based on which window is currently selected. Each menu
18 documented below indicates which window type it is associated with. Click on
19 the dotted line at the top of a menu to "tear it off": a separate window
20 containing the menu is created (for Unix and Windows only).
21
22 File Menu (Shell and Editor):
7 23
8 New Window -- Create a new editing window 24 New Window -- Create a new editing window
9 Open... -- Open an existing file 25 Open... -- Open an existing file
26 Open Module... -- Open an existing module (searches sys.path)
10 Recent Files... -- Open a list of recent files 27 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 28 Class Browser -- Show classes and methods in current file
13 » Path Browser -- Show sys.path directories, modules, classes 29 » Path Browser -- Show sys.path directories, modules, classes,
14 and methods 30 and methods
15 --- 31 ---
16 Save -- Save current window to the associated file (unsaved 32 Save -- Save current window to the associated file (unsaved
17 windows have a * before and after the window title) 33 windows have a * before and after the window title)
18 34
19 Save As... -- Save current window to new file, which becomes 35 Save As... -- Save current window to new file, which becomes
20 the associated file 36 the associated file
21 Save Copy As... -- Save current window to different file 37 Save Copy As... -- Save current window to different file
22 without changing the associated file 38 without changing the associated file
23 --- 39 ---
24 Print Window -- Print the current window 40 Print Window -- Print the current window
25 --- 41 ---
26 Close -- Close current window (asks to save if unsaved) 42 Close -- Close current window (asks to save if unsaved)
27 Exit -- Close all windows, quit (asks to save if unsaved) 43 Exit -- Close all windows, quit (asks to save if unsaved)
28 44
29 Edit Menu: 45 Edit Menu (Shell and Editor):
30 46
31 Undo -- Undo last change to current window 47 Undo -- Undo last change to current window
32 (A maximum of 1000 changes may be undone) 48 (a maximum of 1000 changes may be undone)
33 Redo -- Redo last undone change to current window 49 Redo -- Redo last undone change to current window
34 --- 50 ---
35 Cut -- Copy a selection into system-wide clipboard, 51 Cut -- Copy a selection into system-wide clipboard,
36 then delete the selection 52 then delete the selection
37 Copy -- Copy selection into system-wide clipboard 53 Copy -- Copy selection into system-wide clipboard
38 Paste -- Insert system-wide clipboard into window 54 Paste -- Insert system-wide clipboard into window
39 Select All -- Select the entire contents of the edit buffer 55 Select All -- Select the entire contents of the edit buffer
40 --- 56 ---
41 Find... -- Open a search dialog box with many options 57 Find... -- Open a search dialog box with many options
42 Find Again -- Repeat last search 58 Find Again -- Repeat last search
43 Find Selection -- Search for the string in the selection 59 Find Selection -- Search for the string in the selection
44 Find in Files... -- Open a search dialog box for searching files 60 Find in Files... -- Open a search dialog box for searching files
45 Replace... -- Open a search-and-replace dialog box 61 Replace... -- Open a search-and-replace dialog box
46 Go to Line -- Ask for a line number and show that line 62 Go to Line -- Ask for a line number and show that line
47 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
51 Expand Word -- Expand the word you have typed to match another 63 Expand Word -- Expand the word you have typed to match another
52 word in the same buffer; repeat to get a 64 word in the same buffer; repeat to get a
53 different expansion 65 different expansion
66 Show Calltip -- After an unclosed parenthesis for a function, open
67 a small window with function parameter hints
68 Show Parens -- Highlight the surrounding parenthesis
69 Show Completions -- Open a scroll window allowing selection keywords
70 and attributes. (see '*TIPS*', below)
54 71
55 Format Menu (only in Edit window): 72 Format Menu (only in Editor window):
56 73
57 » Indent Region -- Shift selected lines right 4 spaces 74 » Indent Region -- Shift selected lines right by the indent width
58 » Dedent Region -- Shift selected lines left 4 spaces 75 (default 4 spaces)
76 » Dedent Region -- Shift selected lines left by the indent width
77 (default 4 spaces)
59 Comment Out Region -- Insert ## in front of selected lines 78 Comment Out Region -- Insert ## in front of selected lines
60 Uncomment Region -- Remove leading # or ## from selected lines 79 Uncomment Region -- Remove leading # or ## from selected lines
61 » Tabify Region -- Turns *leading* stretches of spaces into tabs 80 » Tabify Region -- Turns *leading* stretches of spaces into tabs.
62 (Note: We recommend using 4 space blocks to indent Python code.) 81 (Note: We recommend using 4 space blocks to indent Python code.)
63 Untabify Region -- Turn *all* tabs into the right number of spaces 82 Untabify Region -- Turn *all* tabs into the right number of spaces
64 » New Indent Width... -- Open dialog to change indent width 83 » New Indent Width... -- Open a dialog to switch between indenting with
84 spaces and tabs. The accepted default by the
85 Python community is 4 spaces.
65 Format Paragraph -- Reformat the current blank-line-separated 86 Format Paragraph -- Reformat the current blank-line-separated
66 paragraph 87 paragraph. All lines in the paragraph will be
88 formatted to less than 80 columns.
89 ---
90 Strip trailing whitespace -- Removed any space characters after the end
91 of the last non-space character
67 92
68 Run Menu (only in Edit window): 93 Run Menu (only in Editor window):
69 94
70 Python Shell -- Open or wake up the Python shell window 95 Python Shell -- Open or wake up the Python shell window
71 --- 96 ---
72 » Check Module -- Run a syntax check on the module 97 » Check Module -- Checks the syntax of the current module which is the
73 » Run Module -- Execute the current file in the __main__ namespace 98 code loaded in the Editor window. If the code has not
99 been saved IDLE will prompt the user to save the code.
100 » Run Module -- First it performs a restart on the shell making sure
101 the environment is clean then executes the current file
102 in the __main__ namespace.
74 103
75 Shell Menu (only in Shell window): 104 Shell Menu (only in Shell window):
76 105
77 » View Last Restart -- Scroll the shell window to the last restart 106 » View Last Restart -- Scroll the shell window to the last Shell restart
78 Restart Shell -- Restart the interpreter with a fresh environment 107 Restart Shell -- Restart the interpreter with a fresh environment
79 108
80 Debug Menu (only in Shell window): 109 Debug Menu (only in Shell window):
81 110
82 » Go to File/Line -- look around the insert point for a filename 111 » Go to File/Line -- Look around the insert point for a filename
83 » » and line number, open the file, and show the line 112 » » and line number, open the file, and show the line.
84 » Debugger (toggle) -- Run commands in the shell under the debugger 113 Useful to view the source lines referenced in an
114 exception traceback. Available in the context
115 menu of the Shell window.
116 » Debugger (toggle) -- Run commands in the shell under the debugger.
117 (Note still experimental).
85 Stack Viewer -- Show the stack traceback of the last exception 118 Stack Viewer -- Show the stack traceback of the last exception
86 » Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback 119 » Auto-open Stack Viewer (toggle) -- Toggle automatically opening the
120 stack viewer on a traceback
87 121
88 Options Menu: 122 Options Menu (Shell and Editor):
89 123
90 Configure IDLE -- Open a configuration dialog. Fonts, indentation, 124 Configure IDLE -- Open a configuration dialog. Fonts, indentation,
91 keybindings, and color themes may be altered. 125 keybindings, and color themes may be altered.
92 Startup Preferences may be set, and Additional Help 126 Startup Preferences may be set, and additional Help
93 Sources can be specified. 127 sources can be specified.
94 128
95 On OS X this menu is not present, use
96 menu 'IDLE -> Preferences...' instead.
97 --- 129 ---
98 » Code Context --» Open a pane at the top of the edit window which 130 » Code Context (toggle) -- Open a pane at the top of the edit window
99 » » » shows the block context of the section of code 131 which shows the block context of the section
100 » » » which is scrolling off the top or the window. 132 of code which is scrolling off the top or the
101 » » » (Not present in Shell window.) 133 window. This is not present in the Shell
134 window only the Editor window.
102 135
103 Windows Menu: 136 Windows Menu (Shell and Editor):
104 137
105 » Zoom Height -- toggles the window between configured size 138 » Zoom Height -- Toggles the window between normal size (40x80 initial
106 » and maximum height. 139 setting) and maximum height. The initial size is in the Configure
140 IDLE dialog under the general tab.
107 --- 141 ---
108 The rest of this menu lists the names of all open windows; 142 The rest of this menu lists the names of all open windows;
109 select one to bring it to the foreground (deiconifying it if 143 select one to bring it to the foreground (deiconifying it if
110 necessary). 144 necessary).
111 145
112 Help Menu: 146 Help Menu:
113 147
114 About IDLE -- Version, copyright, license, credits 148 About IDLE -- Version, copyright, license, credits
115 IDLE Readme -- Background discussion and change details
116 --- 149 ---
117 » IDLE Help -- Display this file 150 » IDLE Help -- Display this file which is a help file for IDLE
151 detailing the menu options, basic editing and navigation,
152 and other tips.
118 Python Docs -- Access local Python documentation, if 153 Python Docs -- Access local Python documentation, if
119 » » installed. Otherwise, access www.python.org. 154 » » installed. Or will start a web browser and open
155 docs.python.org showing the latest Python documentation.
120 --- 156 ---
121 » (Additional Help Sources may be added here) 157 Additional help sources may be added here with the Configure IDLE
158 dialog under the General tab.
122 159
123 Edit context menu (Right-click / Control-click on OS X in Edit window): 160 Editor context menu (Right-click / Control-click on OS X in Edit window):
124 161
125 Cut -- Copy a selection into system-wide clipboard, 162 Cut -- Copy a selection into system-wide clipboard,
126 then delete the selection 163 then delete the selection
127 Copy -- Copy selection into system-wide clipboard 164 Copy -- Copy selection into system-wide clipboard
128 Paste -- Insert system-wide clipboard into window 165 Paste -- Insert system-wide clipboard into window
129 » Set Breakpoint -- Sets a breakpoint (when debugger open) 166 » Set Breakpoint -- Sets a breakpoint. Breakpoints are only enabled
167 when the debugger is open.
130 Clear Breakpoint -- Clears the breakpoint on that line 168 Clear Breakpoint -- Clears the breakpoint on that line
131 169
132 Shell context menu (Right-click / Control-click on OS X in Shell window): 170 Shell context menu (Right-click / Control-click on OS X in Shell window):
133 171
134 Cut -- Copy a selection into system-wide clipboard, 172 Cut -- Copy a selection into system-wide clipboard,
135 then delete the selection 173 then delete the selection
136 Copy -- Copy selection into system-wide clipboard 174 Copy -- Copy selection into system-wide clipboard
137 Paste -- Insert system-wide clipboard into window 175 Paste -- Insert system-wide clipboard into window
138 --- 176 ---
139 Go to file/line -- Same as in Debug menu 177 Go to file/line -- Same as in Debug menu
(...skipping 22 matching lines...) Expand all
162 Control-backspace deletes word left, Control-DEL deletes word right. 200 Control-backspace deletes word left, Control-DEL deletes word right.
163 Arrow keys and Page Up/Down move around. 201 Arrow keys and Page Up/Down move around.
164 Control-left/right Arrow moves by words in a strange but useful way. 202 Control-left/right Arrow moves by words in a strange but useful way.
165 Home/End go to begin/end of line. 203 Home/End go to begin/end of line.
166 Control-Home/End go to begin/end of file. 204 Control-Home/End go to begin/end of file.
167 Some useful Emacs bindings are inherited from Tcl/Tk: 205 Some useful Emacs bindings are inherited from Tcl/Tk:
168 Control-a beginning of line 206 Control-a beginning of line
169 Control-e end of line 207 Control-e end of line
170 Control-k kill line (but doesn't put it in clipboard) 208 Control-k kill line (but doesn't put it in clipboard)
171 Control-l center window around the insertion point 209 Control-l center window around the insertion point
172 » Standard Windows bindings may work on that platform. 210 » Standard Windows bindings (like Control-c to copy and Control-v to
173 » Keybindings are selected in the Settings Dialog, look there. 211 paste) may work. Keybindings are selected in the Configure IDLE
212 dialog.
174 213
175 Automatic indentation: 214 Automatic indentation:
176 215
177 After a block-opening statement, the next line is indented by 4 spaces 216 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 217 (in the Python Shell window by one tab). After certain keywords
179 (break, return etc.) the next line is dedented. In leading 218 (break, return etc.) the next line is dedented. In leading
180 indentation, Backspace deletes up to 4 spaces if they are there. Tab 219 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 220 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 221 Indent Width. (N.B. Currently tabs are restricted to four spaces due
183 to Tcl/Tk issues.) 222 to Tcl/Tk issues.)
184 223
185 See also the indent/dedent region commands in the edit menu. 224 See also the indent/dedent region commands in the edit menu.
186 225
187 Completions: 226 Completions:
188 227
189 Completions are supplied for functions, classes, and attributes of 228 Completions are supplied for functions, classes, and attributes of
190 classes, both built-in and user-defined. Completions are also provided 229 classes, both built-in and user-defined. Completions are also provided
191 for filenames. 230 for filenames.
192 231
193 The AutoCompleteWindow (ACW) will open after a predefined delay 232 The AutoCompleteWindow (ACW) will open after a predefined delay
194 (default is two seconds) after a '.' or (in a string) an os.sep is 233 (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 234 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 235 » characters) you type a tab the ACW will open immediately if a possible
197 continuation is found. 236 continuation is found.
198 237
199 If there is only one possible completion for the characters entered, a 238 If there is only one possible completion for the characters entered, a
200 » Tab will supply that completion without opening the ACW. 239 » tab will supply that completion without opening the ACW.
201 240
202 » 'Show Completions' will force open a completions window. In an empty 241 » 'Show Completions' will force open a completions window, by default the
242 Control-space keys will open a completions window. In an empty
203 string, this will contain the files in the current directory. On a 243 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 244 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 245 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. 246 characters have been entered, the ACW will attempt to be more specific.
207 247
208 If string of characters is typed, the ACW selection will jump to the 248 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 249 » 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 250 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 251 » 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 252 » will return or a double click. Cursor keys, Page Up/Down, mouse
213 » selection, and the scrollwheel all operate on the ACW. 253 » selection, and the scroll wheel all operate on the ACW.
214 254
215 'Hidden' attributes can be accessed by typing the beginning of hidden 255 'Hidden' attributes can be accessed by typing the beginning of hidden
216 name after a '.'. e.g. '_'. This allows access to modules with 256 name after a '.'. e.g. '_'. This allows access to modules with
217 '__all__' set, or to class-private attributes. 257 '__all__' set, or to class-private attributes.
218 258
219 Completions and the 'Expand Word' facility can save a lot of typing! 259 Completions and the 'Expand Word' facility can save a lot of typing!
220 260
221 Completions are currently limited to those in the namespaces. Names in 261 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 262 » an Editor window which are not via __main__ or sys.modules will not be
223 found. Run the module once with your imports to correct this 263 found. Run the module once with your imports to correct this
224 situation. Note that IDLE itself places quite a few modules in 264 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. 265 sys.modules, so much can be found by default, e.g. the re module.
226 266
227 If you don't like the ACW popping up unbidden, simply make the delay 267 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. 268 » longer or disable the extension. Or another option is the delay could
229 269 be set to zero. Another alternative to preventing ACW popups is to
230 » You could also switch off the CallTips extension. (We will be adding 270 disable the call tips extension.
231 » a delay to the call tip window.)
232 271
233 Python Shell window: 272 Python Shell window:
234 273
235 Control-c interrupts executing command. 274 Control-c interrupts executing command.
236 Control-d sends end-of-file; closes window if typed at >>> prompt 275 Control-d sends end-of-file; closes window if typed at >>> prompt
237 (this is Control-z on Windows). 276 (this is Control-z on Windows).
277 Alt-/ expand word is also useful to reduce typing.
238 278
239 Command history: 279 Command history:
240 280
241 » Alt-p retrieves previous command matching what you have typed. 281 » Alt-p retrieves previous command matching what you have typed. On OS X
242 » Alt-n retrieves next. 282 use Control-p.
243 » (These are Control-p, Control-n on OS X) 283 » Alt-n retrieves next. On OS X use Control-n.
244 Return while cursor is on a previous command retrieves that command. 284 Return while cursor is on a previous command retrieves that command.
245 Expand word is also useful to reduce typing.
246 285
247 Syntax colors: 286 Syntax colors:
248 287
249 The coloring is applied in a background "thread", so you may 288 The coloring is applied in a background "thread", so you may
250 occasionally see uncolorized text. To change the color 289 occasionally see uncolorized text. To change the color
251 scheme, use the Configure IDLE / Highlighting dialog. 290 scheme, use the Configure IDLE / Highlighting dialog.
252 291
253 Python default syntax colors: 292 Python default syntax colors:
254 293
255 Keywords orange 294 Keywords orange
256 Builtins royal purple 295 Builtins royal purple
257 Strings green 296 Strings green
258 Comments red 297 Comments red
259 Definitions blue 298 Definitions blue
260 299
261 Shell default colors: 300 Shell default colors:
262 301
263 Console output brown 302 Console output brown
264 stdout blue 303 stdout blue
265 stderr red 304 stderr red
266 stdin black 305 stdin black
267 306
268 Other preferences: 307 Other preferences:
269 308
270 » The font preferences, keybinding, and startup preferences can 309 The font preferences, highlighting, keys, and general preferences can
271 » be changed using the Settings dialog. 310 be changed via the Configure IDLE menu option. Be sure to note that
311 keys can be user defined, IDLE ships with four built in key sets. In
312 addition a user can create a custom key set in the Configure IDLE
313 dialog under the keys tab.
272 314
273 Command line usage: 315 Command line usage:
274 316
275 Enter idle -h at the command prompt to get a usage message. 317 Enter idle -h at the command prompt to get a usage message.
276 318
277 Running without a subprocess: (DEPRECATED) 319 idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
278 320
279 » If IDLE is started with the -n command line switch it will run in a 321 -c command run this command
280 » single process and will not create the subprocess which runs the RPC 322 -d enable debugger
281 » Python execution server. This can be useful if Python cannot create 323 -e edit mode; arguments are files to be edited
282 » the subprocess or the RPC socket interface on your platform. However, 324 -s run $IDLESTARTUP or $PYTHONSTARTUP first
283 » in this mode user code is not isolated from IDLE itself. Also, the 325 -t title set title of shell window
284 » environment is not restarted when Run/Run Module (F5) is selected. If 326
285 » your code has been modified, you must reload() the affected modules and 327 If there are arguments:
286 » re-import any specific items (e.g. from foo import baz) if the changes 328 1. If -e is used, arguments are files opened for editing and sys.argv
287 » are to take effect. For these reasons, it is preferable to run IDLE 329 reflects the arguments passed to IDLE itself.
288 » with the default subprocess if at all possible. 330 2. Otherwise, if -c is used, all arguments are placed in
331 sys.argv[1:...], with sys.argv[0] set to -c.
332 3. Otherwise, if neither -e nor -c is used, the first argument is a
333 script which is executed with the remaining arguments in
334 sys.argv[1:...] and sys.argv[0] set to the script name. If the
335 script name is -, no script is executed but an interactive Python
336 session is started; the arguments are still available in sys.argv.
289 337
290 Extensions: 338 Extensions:
291 339
292 IDLE contains an extension facility. See the beginning of 340 IDLE contains an extension facility. See the beginning of
293 config-extensions.def in the idlelib directory for further information. 341 config-extensions.def in the idlelib directory for further information.
294 The default extensions are currently: 342 The default extensions are currently:
295 343
296 FormatParagraph 344 FormatParagraph
297 AutoExpand 345 AutoExpand
298 ZoomHeight 346 ZoomHeight
299 ScriptBinding 347 ScriptBinding
300 CallTips 348 CallTips
301 ParenMatch 349 ParenMatch
302 AutoComplete 350 AutoComplete
303 CodeContext 351 CodeContext
OLDNEW
« Doc/library/idle.rst ('K') | « Doc/library/idle.rst ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+