Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 1 | [See the end of this file for ** TIPS ** on using IDLE !!] |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 2 | |
| 3 | Click on the dotted line at the top of a menu to "tear it off": a |
| 4 | separate window containing the menu is created. |
| 5 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 6 | File Menu: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 7 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 8 | New Window -- Create a new editing window |
| 9 | 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 Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 15 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 16 | Save -- Save current window to the associated file (unsaved |
| 17 | windows have a * before and after the window title) |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 18 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 19 | 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. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 23 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 24 | Print Window -- Print the current window |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 25 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 26 | Close -- Close current window (asks to save if unsaved) |
| 27 | Exit -- Close all windows, quit (asks to save if unsaved) |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 28 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 29 | Edit Menu: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 30 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 31 | 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 Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 34 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 35 | 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 Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 40 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 41 | 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 Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 44 | Find in Files... -- Open a search dialog box for searching files |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 45 | Replace... -- Open a search-and-replace dialog box |
| 46 | Go to Line -- Ask for a line number and show that line |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 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 |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 51 | 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. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 54 | |
| 55 | Format Menu (only in Edit window): |
| 56 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 57 | 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. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 62 | (Note: We recommend using 4 space blocks to indent Python code.) |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 63 | Untabify Region -- Turn *all* tabs into the right number of spaces |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 64 | New Indent Width... -- Open dialog to change indent width |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 65 | Format Paragraph -- Reformat the current blank-line-separated |
| 66 | paragraph |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 67 | |
| 68 | Run Menu (only in Edit window): |
| 69 | |
| 70 | Python Shell -- Open or wake up the Python shell window |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 71 | --- |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 72 | Check Module -- Run a syntax check on the module |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 73 | Run Module -- Execute the current file in the __main__ namespace |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 74 | |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 75 | Shell Menu (only in Shell window): |
| 76 | |
| 77 | View Last Restart -- Scroll the shell window to the last restart |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 78 | Restart Shell -- Restart the interpreter with a fresh environment |
| 79 | |
| 80 | Debug Menu (only in Shell window): |
| 81 | |
| 82 | Go to File/Line -- look around the insert point for a filename |
| 83 | and linenumber, open the file, and show the line |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 84 | Debugger (toggle) -- Run commands in the shell under the debugger |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 85 | Stack Viewer -- Show the stack traceback of the last exception |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 86 | Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback |
| 87 | |
| 88 | Options Menu: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 89 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 90 | Configure IDLE -- Open a configuration dialog. Fonts, indentation, |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 91 | keybindings, and color themes may be altered. |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 92 | Startup Preferences may be set, and Additional Help |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 93 | Souces can be specified. |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 94 | --- |
Kurt B. Kaiser | d00587a | 2004-04-24 03:08:13 +0000 | [diff] [blame] | 95 | Code Context -- Open a pane at the top of the edit window which |
| 96 | shows the block context of the section of code |
| 97 | which is scrolling off the top or the window. |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 98 | (Not present in Shell window.) |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 99 | |
| 100 | Windows Menu: |
| 101 | |
| 102 | Zoom Height -- toggles the window between configured size |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 103 | and maximum height. |
| 104 | --- |
| 105 | The rest of this menu lists the names of all open windows; |
| 106 | select one to bring it to the foreground (deiconifying it if |
| 107 | necessary). |
| 108 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 109 | Help Menu: |
| 110 | |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 111 | About IDLE -- Version, copyright, license, credits |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 112 | IDLE Readme -- Background discussion and change details |
| 113 | --- |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 114 | IDLE Help -- Display this file |
| 115 | Python Docs -- Access local Python documentation, if |
| 116 | installed. Otherwise, access www.python.org. |
| 117 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 118 | (Additional Help Sources may be added here) |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 119 | |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 120 | |
| 121 | ** TIPS ** |
| 122 | ========== |
| 123 | |
| 124 | Additional Help Sources: |
| 125 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 126 | Windows users can Google on zopeshelf.chm to access Zope help files in |
| 127 | the Windows help format. The Additional Help Sources feature of the |
| 128 | configuration GUI supports .chm, along with any other filetypes |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 129 | supported by your browser. Supply a Menu Item title, and enter the |
| 130 | location in the Help File Path slot of the New Help Source dialog. Use |
| 131 | http:// and/or www. to identify external URLs, or download the file and |
| 132 | browse for its path on your machine using the Browse button. |
| 133 | |
| 134 | All users can access the extensive sources of help, including |
| 135 | tutorials, available at www.python.org/doc. Selected URLs can be added |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 136 | or removed from the Help menu at any time using Configure IDLE. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 137 | |
| 138 | Basic editing and navigation: |
| 139 | |
Kurt B. Kaiser | df506ea | 2005-06-12 04:33:30 +0000 | [diff] [blame] | 140 | Backspace deletes char to the left; DEL deletes char to the right. |
| 141 | Control-backspace deletes word left, Control-DEL deletes word right. |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 142 | Arrow keys and Page Up/Down move around. |
| 143 | Control-left/right Arrow moves by words in a strange but useful way. |
| 144 | Home/End go to begin/end of line. |
| 145 | Control-Home/End go to begin/end of file. |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 146 | Some useful Emacs bindings are inherited from Tcl/Tk: |
| 147 | Control-a beginning of line |
| 148 | Control-e end of line |
| 149 | Control-k kill line (but doesn't put it in clipboard) |
| 150 | Control-l center window around the insertion point |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 151 | Standard Windows bindings may work on that platform. |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 152 | Keybindings are selected in the Settings Dialog, look there. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 153 | |
| 154 | Automatic indentation: |
| 155 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 156 | After a block-opening statement, the next line is indented by 4 spaces |
| 157 | (in the Python Shell window by one tab). After certain keywords |
| 158 | (break, return etc.) the next line is dedented. In leading |
| 159 | indentation, Backspace deletes up to 4 spaces if they are there. Tab |
| 160 | inserts spaces (in the Python Shell window one tab), number depends on |
| 161 | Indent Width. (N.B. Currently tabs are restricted to four spaces due |
| 162 | to Tcl/Tk issues.) |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 163 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 164 | See also the indent/dedent region commands in the edit menu. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 165 | |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 166 | Completions: |
| 167 | |
| 168 | Completions are supplied for functions, classes, and attributes of |
| 169 | classes, both built-in and user-defined. Completions are also provided |
| 170 | for filenames. |
| 171 | |
| 172 | The AutoCompleteWindow (ACW) will open after a predefined delay |
| 173 | (default is two seconds) after a '.' or (in a string) an os.sep is |
| 174 | typed. If after one of those characters (plus zero or more other |
| 175 | characters) you type a Tab the ACW will open immediately if a possible |
| 176 | continuation is found. |
| 177 | |
| 178 | If there is only one possible completion for the characters entered, a |
| 179 | Tab will supply that completion without opening the ACW. |
| 180 | |
| 181 | 'Show Completions' will force open a completions window. In an empty |
| 182 | string, this will contain the files in the current directory. On a |
| 183 | blank line, it will contain the built-in and user-defined functions and |
| 184 | classes in the current name spaces, plus any modules imported. If some |
| 185 | characters have been entered, the ACW will attempt to be more specific. |
| 186 | |
| 187 | If string of characters is typed, the ACW selection will jump to the |
| 188 | entry most closely matching those characters. Entering a Tab will cause |
| 189 | the longest non-ambiguous match to be entered in the Edit window or |
| 190 | Shell. Two Tabs in a row will supply the current ACW selection, as |
| 191 | will Return or a double click. Cursor keys, Page Up/Down, mouse |
| 192 | selection, and the scrollwheel all operate on the ACW. |
| 193 | |
| 194 | 'Hidden' attributes can be accessed by typing the beginning of hidden |
| 195 | name after a '.'. e.g. '_'. This allows access to modules with |
| 196 | '__all__' set, or to class-private attributes. |
| 197 | |
| 198 | Completions and the 'Expand Word' facility can save a lot of typing! |
| 199 | |
| 200 | Completions are currently limited to those in the namespaces. Names in |
| 201 | an Edit window which are not via __main__ or sys.modules will not be |
| 202 | found. Run the module once with your imports to correct this |
| 203 | situation. Note that IDLE itself places quite a few modules in |
| 204 | sys.modules, so much can be found by default, e.g. the re module. |
| 205 | |
| 206 | If you don't like the ACW popping up unbidden, simply make the delay |
| 207 | longer or disable the extension. OTOH, you could make the delay zero. |
| 208 | |
| 209 | You could also switch off the CallTips extension. (We will be adding |
| 210 | a delay to the call tip window.) |
| 211 | |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 212 | Python Shell window: |
| 213 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 214 | Control-c interrupts executing command. |
Kurt B. Kaiser | cca9122 | 2003-07-16 03:10:43 +0000 | [diff] [blame] | 215 | Control-d sends end-of-file; closes window if typed at >>> prompt |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 216 | (this is Control-z on Windows). |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 217 | |
| 218 | Command history: |
| 219 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 220 | Alt-p retrieves previous command matching what you have typed. |
| 221 | Alt-n retrieves next. |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 222 | (These are Control-p, Control-n on the Mac) |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 223 | Return while cursor is on a previous command retrieves that command. |
| 224 | Expand word is also useful to reduce typing. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 225 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 226 | Syntax colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 227 | |
| 228 | The coloring is applied in a background "thread", so you may |
| 229 | occasionally see uncolorized text. To change the color |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 230 | scheme, use the Configure IDLE / Highlighting dialog. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 231 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 232 | Python default syntax colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 233 | |
| 234 | Keywords orange |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 235 | Builtins royal purple |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 236 | Strings green |
| 237 | Comments red |
| 238 | Definitions blue |
| 239 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 240 | Shell default colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 241 | |
| 242 | Console output brown |
| 243 | stdout blue |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 244 | stderr red |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 245 | stdin black |
| 246 | |
| 247 | Other preferences: |
| 248 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 249 | The font preferences, keybinding, and startup preferences can |
| 250 | be changed using the Settings dialog. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 251 | |
| 252 | Command line usage: |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 253 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 254 | Enter idle -h at the command prompt to get a usage message. |
Kurt B. Kaiser | 8f570a7 | 2003-05-15 18:52:51 +0000 | [diff] [blame] | 255 | |
| 256 | Running without a subprocess: |
| 257 | |
| 258 | If IDLE is started with the -n command line switch it will run in a |
| 259 | single process and will not create the subprocess which runs the RPC |
| 260 | Python execution server. This can be useful if Python cannot create |
| 261 | the subprocess or the RPC socket interface on your platform. However, |
| 262 | in this mode user code is not isolated from IDLE itself. Also, the |
| 263 | environment is not restarted when Run/Run Module (F5) is selected. If |
| 264 | your code has been modified, you must reload() the affected modules and |
| 265 | re-import any specific items (e.g. from foo import baz) if the changes |
| 266 | are to take effect. For these reasons, it is preferable to run IDLE |
| 267 | with the default subprocess if at all possible. |
Kurt B. Kaiser | 209de1f | 2007-02-08 22:58:18 +0000 | [diff] [blame] | 268 | |
| 269 | Extensions: |
| 270 | |
| 271 | IDLE contains an extension facility. See the beginning of |
| 272 | config-extensions.def in the idlelib directory for further information. |
| 273 | The default extensions are currently: |
| 274 | |
| 275 | FormatParagraph |
| 276 | AutoExpand |
| 277 | ZoomHeight |
| 278 | ScriptBinding |
| 279 | CallTips |
| 280 | ParenMatch |
| 281 | AutoComplete |
| 282 | CodeContext |