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