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 |
| 47 | Expand Word -- Expand the word you have typed to match another |
| 48 | word in the same buffer; repeat to get a |
| 49 | different expansion |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 50 | |
| 51 | Format Menu (only in Edit window): |
| 52 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 53 | Indent Region -- Shift selected lines right 4 spaces |
| 54 | Dedent Region -- Shift selected lines left 4 spaces |
| 55 | Comment Out Region -- Insert ## in front of selected lines |
| 56 | Uncomment Region -- Remove leading # or ## from selected lines |
| 57 | Tabify Region -- Turns *leading* stretches of spaces into tabs |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 58 | (Note: We recommend using 4 space blocks to indent Python code.) |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 59 | Untabify Region -- Turn *all* tabs into the right number of spaces |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 60 | New Indent Width... -- Open dialog to change indent width |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 61 | Format Paragraph -- Reformat the current blank-line-separated |
| 62 | paragraph |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 63 | |
| 64 | Run Menu (only in Edit window): |
| 65 | |
| 66 | Python Shell -- Open or wake up the Python shell window |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 67 | --- |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 68 | Check Module -- Run a syntax check on the module |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 69 | Run Module -- Execute the current file in the __main__ namespace |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 70 | |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 71 | Shell Menu (only in Shell window): |
| 72 | |
| 73 | View Last Restart -- Scroll the shell window to the last restart |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 74 | Restart Shell -- Restart the interpreter with a fresh environment |
| 75 | |
| 76 | Debug Menu (only in Shell window): |
| 77 | |
| 78 | Go to File/Line -- look around the insert point for a filename |
| 79 | and linenumber, open the file, and show the line |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 80 | Debugger (toggle) -- Run commands in the shell under the debugger |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 81 | Stack Viewer -- Show the stack traceback of the last exception |
Kurt B. Kaiser | 1061e72 | 2003-01-04 01:43:53 +0000 | [diff] [blame] | 82 | Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback |
| 83 | |
| 84 | Options Menu: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 85 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 86 | Configure IDLE -- Open a configuration dialog. Fonts, indentation, |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 87 | keybindings, and color themes may be altered. |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 88 | Startup Preferences may be set, and Additional Help |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 89 | Souces can be specified. |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 90 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 91 | Revert to Default Settings -- Restore original settings. Not |
| 92 | currently implemented - simply delete |
| 93 | your .idlerc file. |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 94 | |
| 95 | Windows Menu: |
| 96 | |
| 97 | Zoom Height -- toggles the window between configured size |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 98 | and maximum height. |
| 99 | --- |
| 100 | The rest of this menu lists the names of all open windows; |
| 101 | select one to bring it to the foreground (deiconifying it if |
| 102 | necessary). |
| 103 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 104 | Help Menu: |
| 105 | |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 106 | About IDLE -- Version, copyright, license, credits |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 107 | IDLE Readme -- Background discussion and change details |
| 108 | --- |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 109 | IDLE Help -- Display this file |
| 110 | Python Docs -- Access local Python documentation, if |
| 111 | installed. Otherwise, access www.python.org. |
| 112 | --- |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 113 | (Additional Help Sources may be added here) |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 114 | |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 115 | |
| 116 | ** TIPS ** |
| 117 | ========== |
| 118 | |
| 119 | Additional Help Sources: |
| 120 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 121 | Windows users can Google on zopeshelf.chm to access Zope help files in |
| 122 | the Windows help format. The Additional Help Sources feature of the |
| 123 | configuration GUI supports .chm, along with any other filetypes |
Kurt B. Kaiser | 6fa0911 | 2003-01-14 22:06:11 +0000 | [diff] [blame] | 124 | supported by your browser. Supply a Menu Item title, and enter the |
| 125 | location in the Help File Path slot of the New Help Source dialog. Use |
| 126 | http:// and/or www. to identify external URLs, or download the file and |
| 127 | browse for its path on your machine using the Browse button. |
| 128 | |
| 129 | All users can access the extensive sources of help, including |
| 130 | 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] | 131 | or removed from the Help menu at any time using Configure IDLE. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 132 | |
| 133 | Basic editing and navigation: |
| 134 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 135 | Backspace deletes to the left; DEL deletes to the right. |
| 136 | Arrow keys and Page Up/Down move around. |
| 137 | Control-left/right Arrow moves by words in a strange but useful way. |
| 138 | Home/End go to begin/end of line. |
| 139 | Control-Home/End go to begin/end of file. |
| 140 | Some useful Emacs bindings (Control-a, Control-e, Control-k, etc.) |
| 141 | are inherited from Tcl/Tk. |
| 142 | Standard Windows bindings may work on that platform. |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 143 | Keybindings are selected in the Settings Dialog, look there. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 144 | |
| 145 | Automatic indentation: |
| 146 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 147 | After a block-opening statement, the next line is indented by 4 spaces |
| 148 | (in the Python Shell window by one tab). After certain keywords |
| 149 | (break, return etc.) the next line is dedented. In leading |
| 150 | indentation, Backspace deletes up to 4 spaces if they are there. Tab |
| 151 | inserts spaces (in the Python Shell window one tab), number depends on |
| 152 | Indent Width. (N.B. Currently tabs are restricted to four spaces due |
| 153 | to Tcl/Tk issues.) |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 154 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 155 | See also the indent/dedent region commands in the edit menu. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 156 | |
| 157 | Python Shell window: |
| 158 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 159 | Control-c interrupts executing command. |
Kurt B. Kaiser | cca9122 | 2003-07-16 03:10:43 +0000 | [diff] [blame] | 160 | 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] | 161 | (this is Control-z on Windows). |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 162 | |
| 163 | Command history: |
| 164 | |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 165 | Alt-p retrieves previous command matching what you have typed. |
| 166 | Alt-n retrieves next. |
Kurt B. Kaiser | cca9122 | 2003-07-16 03:10:43 +0000 | [diff] [blame] | 167 | (These are Control-p, Control-n on the Mac) |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 168 | Return while cursor is on a previous command retrieves that command. |
| 169 | Expand word is also useful to reduce typing. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 170 | |
Kurt B. Kaiser | eb9637e | 2003-01-26 04:17:16 +0000 | [diff] [blame] | 171 | Syntax colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 172 | |
| 173 | The coloring is applied in a background "thread", so you may |
| 174 | occasionally see uncolorized text. To change the color |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 175 | scheme, use the Configure IDLE / Highlighting dialog. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 176 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 177 | Python default syntax colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 178 | |
| 179 | Keywords orange |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 180 | Builtins royal purple |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 181 | Strings green |
| 182 | Comments red |
| 183 | Definitions blue |
| 184 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 185 | Shell default colors: |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 186 | |
| 187 | Console output brown |
| 188 | stdout blue |
Kurt B. Kaiser | 6e4620b | 2004-03-16 03:36:41 +0000 | [diff] [blame] | 189 | stderr red |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 190 | stdin black |
| 191 | |
| 192 | Other preferences: |
| 193 | |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 194 | The font preferences, keybinding, and startup preferences can |
| 195 | be changed using the Settings dialog. |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 196 | |
| 197 | Command line usage: |
Kurt B. Kaiser | 39c7b45 | 2002-12-11 04:42:39 +0000 | [diff] [blame] | 198 | |
| 199 | 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] | 200 | |
| 201 | Running without a subprocess: |
| 202 | |
| 203 | If IDLE is started with the -n command line switch it will run in a |
| 204 | single process and will not create the subprocess which runs the RPC |
| 205 | Python execution server. This can be useful if Python cannot create |
| 206 | the subprocess or the RPC socket interface on your platform. However, |
| 207 | in this mode user code is not isolated from IDLE itself. Also, the |
| 208 | environment is not restarted when Run/Run Module (F5) is selected. If |
| 209 | your code has been modified, you must reload() the affected modules and |
| 210 | re-import any specific items (e.g. from foo import baz) if the changes |
| 211 | are to take effect. For these reasons, it is preferable to run IDLE |
| 212 | with the default subprocess if at all possible. |