Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | .. _idle: |
| 2 | |
Ned Deily | e0944c9 | 2015-02-06 15:41:27 +1100 | [diff] [blame] | 3 | IDLE |
| 4 | ==== |
| 5 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 6 | .. index:: |
Georg Brandl | b19be57 | 2007-12-29 10:57:00 +0000 | [diff] [blame] | 7 | single: IDLE |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 8 | single: Python Editor |
| 9 | single: Integrated Development Environment |
| 10 | |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 11 | .. moduleauthor:: Guido van Rossum <guido@python.org> |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 12 | |
Terry Jan Reedy | 195fc2f | 2015-10-02 23:22:54 -0400 | [diff] [blame] | 13 | IDLE is Python's Integrated Development and Learning Environment. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 14 | |
| 15 | IDLE has the following features: |
| 16 | |
Georg Brandl | c21cd7e | 2008-05-16 17:37:53 +0000 | [diff] [blame] | 17 | * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 18 | |
Terry Jan Reedy | 7cca4e5 | 2015-09-24 03:09:38 -0400 | [diff] [blame] | 19 | * cross-platform: works mostly the same on Windows, Unix, and Mac OS X |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 20 | |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 21 | * Python shell window (interactive interpreter) with colorizing |
| 22 | of code input, output, and error messages |
| 23 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 24 | * multi-window text editor with multiple undo, Python colorizing, |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 25 | smart indent, call tips, auto completion, and other features |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 26 | |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 27 | * search within any window, replace within editor windows, and search |
| 28 | through multiple files (grep) |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 29 | |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 30 | * debugger with persistent breakpoints, stepping, and viewing |
| 31 | of global and local namespaces |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 32 | |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 33 | * configuration, browsers, and other dialogs |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 34 | |
| 35 | Menus |
| 36 | ----- |
| 37 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 38 | IDLE has two main window types, the Shell window and the Editor window. It is |
| 39 | possible to have multiple editor windows simultaneously. Output windows, such |
| 40 | as used for Edit / Find in Files, are a subtype of edit window. They currently |
| 41 | have the same top menu as Editor windows but a different default title and |
| 42 | context menu. |
| 43 | |
| 44 | IDLE's menus dynamically change based on which window is currently selected. |
| 45 | Each menu documented below indicates which window type it is associated with. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 46 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 47 | File menu (Shell and Editor) |
| 48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 49 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 50 | New File |
| 51 | Create a new file editing window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 52 | |
| 53 | Open... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 54 | Open an existing file with an Open dialog. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 55 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 56 | Recent Files |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 57 | Open a list of recent files. Click one to open it. |
| 58 | |
| 59 | Open Module... |
| 60 | Open an existing module (searches sys.path). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 61 | |
| 62 | .. index:: |
| 63 | single: Class browser |
| 64 | single: Path browser |
| 65 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 66 | Class Browser |
| 67 | Show functions, classes, and methods in the current Editor file in a |
| 68 | tree structure. In the shell, open a module first. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 69 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 70 | Path Browser |
| 71 | Show sys.path directories, modules, functions, classes and methods in a |
| 72 | tree structure. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 73 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 74 | Save |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 75 | Save the current window to the associated file, if there is one. Windows |
| 76 | that have been changed since being opened or last saved have a \* before |
| 77 | and after the window title. If there is no associated file, |
| 78 | do Save As instead. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 79 | |
| 80 | Save As... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 81 | Save the current window with a Save As dialog. The file saved becomes the |
| 82 | new associated file for the window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 83 | |
| 84 | Save Copy As... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 85 | Save the current window to different file without changing the associated |
| 86 | file. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 87 | |
| 88 | Print Window |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 89 | Print the current window to the default printer. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 90 | |
| 91 | Close |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 92 | Close the current window (ask to save if unsaved). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 93 | |
| 94 | Exit |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 95 | Close all windows and quit IDLE (ask to save unsaved windows). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 96 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 97 | Edit menu (Shell and Editor) |
| 98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 99 | |
| 100 | Undo |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 101 | Undo the last change to the current window. A maximum of 1000 changes may |
| 102 | be undone. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 103 | |
| 104 | Redo |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 105 | Redo the last undone change to the current window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 106 | |
| 107 | Cut |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 108 | Copy selection into the system-wide clipboard; then delete the selection. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 109 | |
| 110 | Copy |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 111 | Copy selection into the system-wide clipboard. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 112 | |
| 113 | Paste |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 114 | Insert contents of the system-wide clipboard into the current window. |
| 115 | |
| 116 | The clipboard functions are also available in context menus. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 117 | |
| 118 | Select All |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 119 | Select the entire contents of the current window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 120 | |
| 121 | Find... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 122 | Open a search dialog with many options |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 123 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 124 | Find Again |
| 125 | Repeat the last search, if there is one. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 126 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 127 | Find Selection |
| 128 | Search for the currently selected string, if there is one. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 129 | |
| 130 | Find in Files... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 131 | Open a file search dialog. Put results in an new output window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 132 | |
| 133 | Replace... |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 134 | Open a search-and-replace dialog. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 135 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 136 | Go to Line |
| 137 | Move cursor to the line number requested and make that line visible. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 138 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 139 | Show Completions |
| 140 | Open a scrollable list allowing selection of keywords and attributes. See |
| 141 | Completions in the Tips sections below. |
| 142 | |
| 143 | Expand Word |
| 144 | Expand a prefix you have typed to match a full word in the same window; |
| 145 | repeat to get a different expansion. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 146 | |
| 147 | Show call tip |
| 148 | After an unclosed parenthesis for a function, open a small window with |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 149 | function parameter hints. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 150 | |
| 151 | Show surrounding parens |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 152 | Highlight the surrounding parenthesis. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 153 | |
| 154 | Format menu (Editor window only) |
| 155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 156 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 157 | Indent Region |
| 158 | Shift selected lines right by the indent width (default 4 spaces). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 159 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 160 | Dedent Region |
| 161 | Shift selected lines left by the indent width (default 4 spaces). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 162 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 163 | Comment Out Region |
| 164 | Insert ## in front of selected lines. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 165 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 166 | Uncomment Region |
| 167 | Remove leading # or ## from selected lines. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 168 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 169 | Tabify Region |
| 170 | Turn *leading* stretches of spaces into tabs. (Note: We recommend using |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 171 | 4 space blocks to indent Python code.) |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 172 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 173 | Untabify Region |
| 174 | Turn *all* tabs into the correct number of spaces. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 175 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 176 | Toggle Tabs |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 177 | Open a dialog to switch between indenting with spaces and tabs. |
| 178 | |
| 179 | New Indent Width |
| 180 | Open a dialog to change indent width. The accepted default by the Python |
| 181 | community is 4 spaces. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 182 | |
| 183 | Format Paragraph |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 184 | Reformat the current blank-line-delimited paragraph in comment block or |
| 185 | multiline string or selected line in a string. All lines in the |
| 186 | paragraph will be formatted to less than N columns, where N defaults to 72. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 187 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 188 | Strip trailing whitespace |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 189 | Remove any space characters after the last non-space character of a line. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 190 | |
| 191 | .. index:: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 192 | single: Run script |
| 193 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 194 | Run menu (Editor window only) |
| 195 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 196 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 197 | Python Shell |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 198 | Open or wake up the Python Shell window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 199 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 200 | Check Module |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 201 | Check the syntax of the module currently open in the Editor window. If the |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 202 | module has not been saved IDLE will either prompt the user to save or |
| 203 | autosave, as selected in the General tab of the Idle Settings dialog. If |
| 204 | there is a syntax error, the approximate location is indicated in the |
| 205 | Editor window. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 206 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 207 | Run Module |
| 208 | Do Check Module (above). If no error, restart the shell to clean the |
Terry Jan Reedy | cf5bf82 | 2015-09-24 01:39:25 -0400 | [diff] [blame] | 209 | environment, then execute the module. Output is displayed in the Shell |
| 210 | window. Note that output requires use of ``print`` or ``write``. |
| 211 | When execution is complete, the Shell retains focus and displays a prompt. |
| 212 | At this point, one may interactively explore the result of execution. |
| 213 | This is similar to executing a file with ``python -i file`` at a command |
| 214 | line. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 215 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 216 | Shell menu (Shell window only) |
| 217 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 218 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 219 | View Last Restart |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 220 | Scroll the shell window to the last Shell restart. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 221 | |
| 222 | Restart Shell |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 223 | Restart the shell to clean the environment. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 224 | |
| 225 | Debug menu (Shell window only) |
| 226 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 227 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 228 | Go to File/Line |
| 229 | Look on the current line. with the cursor, and the line above for a filename |
| 230 | and line number. If found, open the file if not already open, and show the |
| 231 | line. Use this to view source lines referenced in an exception traceback |
| 232 | and lines found by Find in Files. Also available in the context menu of |
| 233 | the Shell window and Output windows. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 234 | |
| 235 | .. index:: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 236 | single: debugger |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 237 | single: stack viewer |
| 238 | |
| 239 | Debugger (toggle) |
| 240 | When actived, code entered in the Shell or run from an Editor will run |
| 241 | under the debugger. In the Editor, breakpoints can be set with the context |
| 242 | menu. This feature is still incomplete and somewhat experimental. |
| 243 | |
| 244 | Stack Viewer |
| 245 | Show the stack traceback of the last exception in a tree widget, with |
| 246 | access to locals and globals. |
| 247 | |
| 248 | Auto-open Stack Viewer |
| 249 | Toggle automatically opening the stack viewer on an unhandled exception. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 250 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 251 | Options menu (Shell and Editor) |
| 252 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 253 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 254 | Configure IDLE |
Terry Jan Reedy | 1c49ec0 | 2015-10-13 22:03:44 -0400 | [diff] [blame] | 255 | Open a configuration dialog and change preferences for the following: |
| 256 | fonts, indentation, keybindings, text color themes, startup windows and |
| 257 | size, additional help sources, and extensions (see below). On OS X, |
| 258 | open the configuration dialog by selecting Preferences in the application |
| 259 | menu. To use a new built-in color theme (IDLE Dark) with older IDLEs, |
| 260 | save it as a new custom theme. |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 261 | |
Terry Jan Reedy | 1c49ec0 | 2015-10-13 22:03:44 -0400 | [diff] [blame] | 262 | Non-default user settings are saved in a .idlerc directory in the user's |
| 263 | home directory. Problems caused by bad user configuration files are solved |
| 264 | by editing or deleting one or more of the files in .idlerc. |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 265 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 266 | Code Context (toggle)(Editor Window only) |
| 267 | Open a pane at the top of the edit window which shows the block context |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 268 | of the code which has scrolled above the top of the window. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 269 | |
Ned Deily | b5daa3d | 2015-01-17 21:03:41 -0800 | [diff] [blame] | 270 | Window menu (Shell and Editor) |
| 271 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 272 | |
| 273 | Zoom Height |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 274 | Toggles the window between normal size and maximum height. The initial size |
| 275 | defaults to 40 lines by 80 chars unless changed on the General tab of the |
| 276 | Configure IDLE dialog. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 277 | |
| 278 | The rest of this menu lists the names of all open windows; select one to bring |
| 279 | it to the foreground (deiconifying it if necessary). |
| 280 | |
| 281 | Help menu (Shell and Editor) |
| 282 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 283 | |
| 284 | About IDLE |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 285 | Display version, copyright, license, credits, and more. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 286 | |
| 287 | IDLE Help |
| 288 | Display a help file for IDLE detailing the menu options, basic editing and |
| 289 | navigation, and other tips. |
| 290 | |
| 291 | Python Docs |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 292 | Access local Python documentation, if installed, or start a web browser |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 293 | and open docs.python.org showing the latest Python documentation. |
| 294 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 295 | Turtle Demo |
| 296 | Run the turtledemo module with example python code and turtle drawings. |
| 297 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 298 | Additional help sources may be added here with the Configure IDLE dialog under |
| 299 | the General tab. |
| 300 | |
| 301 | .. index:: |
| 302 | single: Cut |
| 303 | single: Copy |
| 304 | single: Paste |
| 305 | single: Set Breakpoint |
| 306 | single: Clear Breakpoint |
| 307 | single: breakpoints |
| 308 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 309 | Context Menus |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 310 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 311 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 312 | Open a context menu by right-clicking in a window (Control-click on OS X). |
| 313 | Context menus have the standard clipboard functions also on the Edit menu. |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 314 | |
Andrew Svetlov | 5018db7 | 2012-11-01 22:39:14 +0200 | [diff] [blame] | 315 | Cut |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 316 | Copy selection into the system-wide clipboard; then delete the selection. |
Andrew Svetlov | 5018db7 | 2012-11-01 22:39:14 +0200 | [diff] [blame] | 317 | |
| 318 | Copy |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 319 | Copy selection into the system-wide clipboard. |
Andrew Svetlov | 5018db7 | 2012-11-01 22:39:14 +0200 | [diff] [blame] | 320 | |
| 321 | Paste |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 322 | Insert contents of the system-wide clipboard into the current window. |
| 323 | |
| 324 | Editor windows also have breakpoint functions. Lines with a breakpoint set are |
| 325 | specially marked. Breakpoints only have an effect when running under the |
| 326 | debugger. Breakpoints for a file are saved in the user's .idlerc directory. |
Andrew Svetlov | 5018db7 | 2012-11-01 22:39:14 +0200 | [diff] [blame] | 327 | |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 328 | Set Breakpoint |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 329 | Set a breakpoint on the current line. |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 330 | |
| 331 | Clear Breakpoint |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 332 | Clear the breakpoint on that line. |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 333 | |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 334 | Shell and Output windows have the following. |
Andrew Svetlov | 5018db7 | 2012-11-01 22:39:14 +0200 | [diff] [blame] | 335 | |
Ned Deily | c859bd2 | 2012-10-20 13:23:25 -0700 | [diff] [blame] | 336 | Go to file/line |
| 337 | Same as in Debug menu. |
| 338 | |
| 339 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 340 | Editing and navigation |
| 341 | ---------------------- |
| 342 | |
Serhiy Storchaka | 9b2e37f | 2015-09-12 17:47:12 +0300 | [diff] [blame] | 343 | In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and |
| 344 | the :kbd:`Command` key on Mac OSX. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 345 | |
| 346 | * :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right |
| 347 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 348 | * :kbd:`C-Backspace` delete word left; :kbd:`C-Del` delete word to the right |
| 349 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 350 | * Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around |
| 351 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 352 | * :kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves by words |
| 353 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 354 | * :kbd:`Home`/:kbd:`End` go to begin/end of line |
| 355 | |
| 356 | * :kbd:`C-Home`/:kbd:`C-End` go to begin/end of file |
| 357 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 358 | * Some useful Emacs bindings are inherited from Tcl/Tk: |
| 359 | |
| 360 | * :kbd:`C-a` beginning of line |
| 361 | |
| 362 | * :kbd:`C-e` end of line |
| 363 | |
| 364 | * :kbd:`C-k` kill line (but doesn't put it in clipboard) |
| 365 | |
| 366 | * :kbd:`C-l` center window around the insertion point |
| 367 | |
| 368 | * :kbd:`C-b` go backwards one character without deleting (usually you can |
| 369 | also use the cursor key for this) |
| 370 | |
| 371 | * :kbd:`C-f` go forward one character without deleting (usually you can |
| 372 | also use the cursor key for this) |
| 373 | |
| 374 | * :kbd:`C-p` go up one line (usually you can also use the cursor key for |
| 375 | this) |
| 376 | |
| 377 | * :kbd:`C-d` delete next character |
| 378 | |
| 379 | Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) |
| 380 | may work. Keybindings are selected in the Configure IDLE dialog. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 381 | |
| 382 | |
| 383 | Automatic indentation |
| 384 | ^^^^^^^^^^^^^^^^^^^^^ |
| 385 | |
| 386 | After a block-opening statement, the next line is indented by 4 spaces (in the |
| 387 | Python Shell window by one tab). After certain keywords (break, return etc.) |
| 388 | the next line is dedented. In leading indentation, :kbd:`Backspace` deletes up |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 389 | to 4 spaces if they are there. :kbd:`Tab` inserts spaces (in the Python |
| 390 | Shell window one tab), number depends on Indent width. Currently tabs |
| 391 | are restricted to four spaces due to Tcl/Tk limitations. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 392 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 393 | See also the indent/dedent region commands in the edit menu. |
| 394 | |
| 395 | Completions |
| 396 | ^^^^^^^^^^^ |
| 397 | |
| 398 | Completions are supplied for functions, classes, and attributes of classes, |
| 399 | both built-in and user-defined. Completions are also provided for |
| 400 | filenames. |
| 401 | |
| 402 | The AutoCompleteWindow (ACW) will open after a predefined delay (default is |
| 403 | two seconds) after a '.' or (in a string) an os.sep is typed. If after one |
| 404 | of those characters (plus zero or more other characters) a tab is typed |
| 405 | the ACW will open immediately if a possible continuation is found. |
| 406 | |
| 407 | If there is only one possible completion for the characters entered, a |
| 408 | :kbd:`Tab` will supply that completion without opening the ACW. |
| 409 | |
| 410 | 'Show Completions' will force open a completions window, by default the |
| 411 | :kbd:`C-space` will open a completions window. In an empty |
| 412 | string, this will contain the files in the current directory. On a |
| 413 | blank line, it will contain the built-in and user-defined functions and |
| 414 | classes in the current name spaces, plus any modules imported. If some |
| 415 | characters have been entered, the ACW will attempt to be more specific. |
| 416 | |
| 417 | If a string of characters is typed, the ACW selection will jump to the |
| 418 | entry most closely matching those characters. Entering a :kbd:`tab` will |
| 419 | cause the longest non-ambiguous match to be entered in the Editor window or |
| 420 | Shell. Two :kbd:`tab` in a row will supply the current ACW selection, as |
| 421 | will return or a double click. Cursor keys, Page Up/Down, mouse selection, |
| 422 | and the scroll wheel all operate on the ACW. |
| 423 | |
| 424 | "Hidden" attributes can be accessed by typing the beginning of hidden |
| 425 | name after a '.', e.g. '_'. This allows access to modules with |
| 426 | ``__all__`` set, or to class-private attributes. |
| 427 | |
| 428 | Completions and the 'Expand Word' facility can save a lot of typing! |
| 429 | |
| 430 | Completions are currently limited to those in the namespaces. Names in |
| 431 | an Editor window which are not via ``__main__`` and :data:`sys.modules` will |
| 432 | not be found. Run the module once with your imports to correct this situation. |
| 433 | Note that IDLE itself places quite a few modules in sys.modules, so |
| 434 | much can be found by default, e.g. the re module. |
| 435 | |
| 436 | If you don't like the ACW popping up unbidden, simply make the delay |
Terry Jan Reedy | 958a9c7 | 2015-09-29 01:55:50 -0400 | [diff] [blame] | 437 | longer or disable the extension. |
| 438 | |
| 439 | Calltips |
| 440 | ^^^^^^^^ |
| 441 | |
| 442 | A calltip is shown when one types :kbd:`(` after the name of an *acccessible* |
| 443 | function. A name expression may include dots and subscripts. A calltip |
| 444 | remains until it is clicked, the cursor is moved out of the argument area, |
| 445 | or :kbd:`)` is typed. When the cursor is in the argument part of a definition, |
| 446 | the menu or shortcut display a calltip. |
| 447 | |
| 448 | A calltip consists of the function signature and the first line of the |
| 449 | docstring. For builtins without an accessible signature, the calltip |
| 450 | consists of all lines up the fifth line or the first blank line. These |
| 451 | details may change. |
| 452 | |
| 453 | The set of *accessible* functions depends on what modules have been imported |
| 454 | into the user process, including those imported by Idle itself, |
| 455 | and what definitions have been run, all since the last restart. |
| 456 | |
| 457 | For example, restart the Shell and enter ``itertools.count(``. A calltip |
| 458 | appears because Idle imports itertools into the user process for its own use. |
| 459 | (This could change.) Enter ``turtle.write(`` and nothing appears. Idle does |
| 460 | not import turtle. The menu or shortcut do nothing either. Enter |
| 461 | ``import turtle`` and then ``turtle.write(`` will work. |
| 462 | |
| 463 | In an editor, import statements have no effect until one runs the file. One |
| 464 | might want to run a file after writing the import statements at the top, |
| 465 | or immediately run an existing file before editing. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 466 | |
| 467 | Python Shell window |
| 468 | ^^^^^^^^^^^^^^^^^^^ |
| 469 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 470 | * :kbd:`C-c` interrupts executing command |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 471 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 472 | * :kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 473 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 474 | * :kbd:`Alt-/` (Expand word) is also useful to reduce typing |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 475 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 476 | Command history |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 477 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 478 | * :kbd:`Alt-p` retrieves previous command matching what you have typed. On |
| 479 | OS X use :kbd:`C-p`. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 480 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 481 | * :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 482 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 483 | * :kbd:`Return` while on any previous command retrieves that command |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 484 | |
| 485 | |
Terry Jan Reedy | f56f8d1 | 2015-09-24 23:13:43 -0400 | [diff] [blame] | 486 | Text colors |
| 487 | ^^^^^^^^^^^ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 488 | |
Terry Jan Reedy | f56f8d1 | 2015-09-24 23:13:43 -0400 | [diff] [blame] | 489 | Idle defaults to black on white text, but colors text with special meanings. |
| 490 | For the shell, these are shell output, shell error, user output, and |
| 491 | user error. For Python code, at the shell prompt or in an editor, these are |
| 492 | keywords, builtin class and function names, names following ``class`` and |
| 493 | ``def``, strings, and comments. For any text window, these are the cursor (when |
| 494 | present), found text (when possible), and selected text. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 495 | |
Terry Jan Reedy | f56f8d1 | 2015-09-24 23:13:43 -0400 | [diff] [blame] | 496 | Text coloring is done in the background, so uncolorized text is occasionally |
| 497 | visible. To change the color scheme, use the Configure IDLE dialog |
| 498 | Highlighting tab. The marking of debugger breakpoint lines in the editor and |
| 499 | text in popups and dialogs is not user-configurable. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 500 | |
| 501 | |
Terry Jan Reedy | 7cca4e5 | 2015-09-24 03:09:38 -0400 | [diff] [blame] | 502 | Startup and code execution |
| 503 | -------------------------- |
Georg Brandl | 09827eb | 2009-03-15 21:51:48 +0000 | [diff] [blame] | 504 | |
| 505 | Upon startup with the ``-s`` option, IDLE will execute the file referenced by |
| 506 | the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 507 | IDLE first checks for ``IDLESTARTUP``; if ``IDLESTARTUP`` is present the file |
| 508 | referenced is run. If ``IDLESTARTUP`` is not present, IDLE checks for |
Georg Brandl | 09827eb | 2009-03-15 21:51:48 +0000 | [diff] [blame] | 509 | ``PYTHONSTARTUP``. Files referenced by these environment variables are |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 510 | convenient places to store functions that are used frequently from the IDLE |
Georg Brandl | 09827eb | 2009-03-15 21:51:48 +0000 | [diff] [blame] | 511 | shell, or for executing import statements to import common modules. |
| 512 | |
| 513 | In addition, ``Tk`` also loads a startup file if it is present. Note that the |
| 514 | Tk file is loaded unconditionally. This additional file is ``.Idle.py`` and is |
| 515 | looked for in the user's home directory. Statements in this file will be |
Terry Jan Reedy | bafef5a | 2014-12-05 02:42:54 -0500 | [diff] [blame] | 516 | executed in the Tk namespace, so this file is not useful for importing |
| 517 | functions to be used from IDLE's Python shell. |
Georg Brandl | 09827eb | 2009-03-15 21:51:48 +0000 | [diff] [blame] | 518 | |
| 519 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 520 | Command line usage |
| 521 | ^^^^^^^^^^^^^^^^^^ |
| 522 | |
| 523 | :: |
| 524 | |
Terry Jan Reedy | c7025c6 | 2015-09-23 03:52:18 -0400 | [diff] [blame] | 525 | idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ... |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 526 | |
Terry Jan Reedy | c7025c6 | 2015-09-23 03:52:18 -0400 | [diff] [blame] | 527 | -c command run command in the shell window |
| 528 | -d enable debugger and open shell window |
| 529 | -e open editor window |
| 530 | -h print help message with legal combinatios and exit |
| 531 | -i open shell window |
| 532 | -r file run file in shell window |
| 533 | -s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 534 | -t title set title of shell window |
Terry Jan Reedy | c7025c6 | 2015-09-23 03:52:18 -0400 | [diff] [blame] | 535 | - run stdin in shell (- must be last option before args) |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 536 | |
| 537 | If there are arguments: |
| 538 | |
Terry Jan Reedy | c7025c6 | 2015-09-23 03:52:18 -0400 | [diff] [blame] | 539 | * If ``-``, ``-c``, or ``r`` is used, all arguments are placed in |
| 540 | ``sys.argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``, |
| 541 | or ``'-r'``. No editor window is opened, even if that is the default |
| 542 | set in the Options dialog. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 543 | |
Terry Jan Reedy | c7025c6 | 2015-09-23 03:52:18 -0400 | [diff] [blame] | 544 | * Otherwise, arguments are files opened for editing and |
| 545 | ``sys.argv`` reflects the arguments passed to IDLE itself. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 546 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 547 | |
Terry Jan Reedy | 7cca4e5 | 2015-09-24 03:09:38 -0400 | [diff] [blame] | 548 | IDLE-console differences |
| 549 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 550 | |
| 551 | As much as possible, the result of executing Python code with IDLE is the |
| 552 | same as executing the same code in a console window. However, the different |
| 553 | interface and operation occasionally affects results. |
| 554 | |
| 555 | For instance, IDLE normally executes user code in a separate process from |
| 556 | the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the |
| 557 | execution process get input from and send output to the GUI process, |
| 558 | which keeps control of the keyboard and screen. This is normally transparent, |
| 559 | but code that access these object will see different attribute values. |
| 560 | Also, functions that directly access the keyboard and screen will not work. |
| 561 | |
| 562 | With IDLE's Shell, one enters, edits, and recalls complete statements. |
| 563 | Some consoles only work with a single physical line at a time. |
| 564 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 565 | Running without a subprocess |
| 566 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 567 | |
Terry Jan Reedy | 7cca4e5 | 2015-09-24 03:09:38 -0400 | [diff] [blame] | 568 | By default, IDLE executes user code in a separate subprocess via a socket, |
Terry Jan Reedy | 6741a5a | 2015-09-23 20:00:22 -0400 | [diff] [blame] | 569 | which uses the internal loopback interface. This connection is not |
| 570 | externally visible and no data is sent to or received from the Internet. |
| 571 | If firewall software complains anyway, you can ignore it. |
| 572 | |
| 573 | If the attempt to make the socket connection fails, Idle will notify you. |
| 574 | Such failures are sometimes transient, but if persistent, the problem |
| 575 | may be either a firewall blocking the connecton or misconfiguration of |
| 576 | a particular system. Until the problem is fixed, one can run Idle with |
| 577 | the -n command line switch. |
| 578 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 579 | If IDLE is started with the -n command line switch it will run in a |
| 580 | single process and will not create the subprocess which runs the RPC |
| 581 | Python execution server. This can be useful if Python cannot create |
| 582 | the subprocess or the RPC socket interface on your platform. However, |
| 583 | in this mode user code is not isolated from IDLE itself. Also, the |
| 584 | environment is not restarted when Run/Run Module (F5) is selected. If |
| 585 | your code has been modified, you must reload() the affected modules and |
| 586 | re-import any specific items (e.g. from foo import baz) if the changes |
| 587 | are to take effect. For these reasons, it is preferable to run IDLE |
| 588 | with the default subprocess if at all possible. |
| 589 | |
| 590 | .. deprecated:: 3.4 |
| 591 | |
| 592 | |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 593 | Help and preferences |
| 594 | -------------------- |
| 595 | |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 596 | Additional help sources |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 597 | ^^^^^^^^^^^^^^^^^^^^^^^ |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 598 | |
| 599 | IDLE includes a help menu entry called "Python Docs" that will open the |
| 600 | extensive sources of help, including tutorials, available at docs.python.org. |
| 601 | Selected URLs can be added or removed from the help menu at any time using the |
| 602 | Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for |
| 603 | more information. |
| 604 | |
| 605 | |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 606 | Setting preferences |
| 607 | ^^^^^^^^^^^^^^^^^^^ |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 608 | |
| 609 | The font preferences, highlighting, keys, and general preferences can be |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 610 | changed via Configure IDLE on the Option menu. Keys can be user defined; |
| 611 | IDLE ships with four built in key sets. In addition a user can create a |
| 612 | custom key set in the Configure IDLE dialog under the keys tab. |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 613 | |
| 614 | |
| 615 | Extensions |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 616 | ^^^^^^^^^^ |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 617 | |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 618 | IDLE contains an extension facility. Peferences for extensions can be |
| 619 | changed with Configure Extensions. See the beginning of config-extensions.def |
| 620 | in the idlelib directory for further information. The default extensions |
| 621 | are currently: |
Terry Jan Reedy | eb40589 | 2014-12-04 00:55:46 -0500 | [diff] [blame] | 622 | |
| 623 | * FormatParagraph |
| 624 | |
| 625 | * AutoExpand |
| 626 | |
| 627 | * ZoomHeight |
| 628 | |
| 629 | * ScriptBinding |
| 630 | |
| 631 | * CallTips |
| 632 | |
| 633 | * ParenMatch |
| 634 | |
| 635 | * AutoComplete |
| 636 | |
| 637 | * CodeContext |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 638 | |
Terry Jan Reedy | 9e466cf | 2014-12-04 01:22:41 -0500 | [diff] [blame] | 639 | * RstripExtension |