Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 1 | [See end for tips.] |
| 2 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 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. |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 5 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 6 | File menu: |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 7 | |
| 8 | New window -- create a new editing window |
| 9 | Open... -- open an existing file |
| 10 | Open module... -- open an existing module (searches sys.path) |
| 11 | Class browser -- show classes and methods in current file |
| 12 | Path browser -- show sys.path directories, modules, classes |
| 13 | and methods |
| 14 | --- |
| 15 | Save -- save current window to the associated file (unsaved |
| 16 | windows have a * before and after the window title) |
| 17 | |
| 18 | Save As... -- save current window to new file, which becomes |
| 19 | the associated file |
| 20 | Save Copy As... -- save current window to different file |
| 21 | without changing the associated file |
| 22 | --- |
| 23 | Close -- close current window (asks to save if unsaved) |
| 24 | Exit -- close all windows and quit IDLE (asks to save if unsaved) |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 25 | |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 26 | Edit menu: |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 27 | |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 28 | Undo -- Undo last change to current window (max 1000 changes) |
| 29 | Redo -- Redo last undone change to current window |
| 30 | --- |
| 31 | Cut -- Copy selection into system-wide clipboard; then delete selection |
| 32 | Copy -- Copy selection into system-wide clipboard |
| 33 | Paste -- Insert system-wide clipboard into window |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 34 | Select All -- Select the entire contents of the edit buffer |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 35 | --- |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 36 | Find... -- Open a search dialog box with many options |
| 37 | Find again -- Repeat last search |
| 38 | Find selection -- Search for the string in the selection |
| 39 | Find in Files... -- Open a search dialog box for searching files |
| 40 | Replace... -- Open a search-and-replace dialog box |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 41 | Go to line -- Ask for a line number and show that line |
| 42 | --- |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 43 | Indent region -- Shift selected lines right 4 spaces |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 44 | Dedent region -- Shift selected lines left 4 spaces |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 45 | Comment out region -- Insert ## in front of selected lines |
| 46 | Uncomment region -- Remove leading # or ## from selected lines |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 47 | Tabify region -- Turns *leading* stretches of spaces into tabs |
| 48 | Untabify region -- Turn *all* tabs into the right number of spaces |
| 49 | Expand word -- Expand the word you have typed to match another |
| 50 | word in the same buffer; repeat to get a different expansion |
| 51 | Format Paragraph -- Reformat the current blank-line-separated paragraph |
| 52 | --- |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 53 | Import module -- Import or reload the current module |
| 54 | Run script -- Execute the current file in the __main__ namespace |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 55 | |
| 56 | Windows menu: |
| 57 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 58 | Zoom Height -- toggles the window between normal size (24x80) |
| 59 | and maximum height. |
| 60 | --- |
| 61 | The rest of this menu lists the names of all open windows; |
| 62 | select one to bring it to the foreground (deiconifying it if |
| 63 | necessary). |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 64 | |
| 65 | Debug menu (in the Python Shell window only): |
| 66 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 67 | Go to file/line -- look around the insert point for a filename |
| 68 | and linenumber, open the file, and show the line |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 69 | Open stack viewer -- show the stack traceback of the last exception |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 70 | Debugger toggle -- Run commands in the shell under the debugger |
| 71 | JIT Stack viewer toggle -- Open stack viewer on traceback |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 72 | |
| 73 | Basic editing and navigation: |
| 74 | |
| 75 | Backspace deletes to the left; DEL deletes to the right |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 76 | Arrow keys and Page Up/Down to move around |
| 77 | Home/End go to begin/end of line |
| 78 | Control-Home/End go to begin/end of file |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 79 | Some Emacs bindings may also work, e.g. ^B/^P/^A/^E/^D/^L |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 80 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 81 | Automatic indentation: |
Guido van Rossum | 423938a | 1998-10-13 17:38:03 +0000 | [diff] [blame] | 82 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 83 | After a block-opening statement, the next line is indented by |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 84 | 4 spaces (in the Python Shell window by one tab). After |
| 85 | certain keywords (break, return etc.) the next line is |
| 86 | dedented. In leading indentation, Backspace deletes up to 4 |
| 87 | spaces if they are there. Tab inserts 1-4 spaces (in the |
| 88 | Python Shell window one tab). See also the indent/dedent |
| 89 | region commands in the edit menu. |
Guido van Rossum | 423938a | 1998-10-13 17:38:03 +0000 | [diff] [blame] | 90 | |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 91 | Python Shell window: |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 92 | |
| 93 | ^C interrupts executing command |
Guido van Rossum | ca5619c | 1998-10-13 17:32:27 +0000 | [diff] [blame] | 94 | ^D sends end-of-file; closes window if typed at >>> prompt |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | 423938a | 1998-10-13 17:38:03 +0000 | [diff] [blame] | 96 | Command history: |
| 97 | |
| 98 | Alt-p retrieves previous command matching what you have typed |
| 99 | Alt-n retrieves next |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 100 | Return while on any previous command retrieves that command |
| 101 | Alt-/ (Expand word) is also useful here |
Guido van Rossum | 423938a | 1998-10-13 17:38:03 +0000 | [diff] [blame] | 102 | |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 103 | Syntax colors: |
| 104 | |
| 105 | The coloring is applied in a background "thread", so you may |
| 106 | occasionally see uncolorized text. To change the color |
Guido van Rossum | 9d593a5 | 2001-01-19 03:30:58 +0000 | [diff] [blame] | 107 | scheme, edit the [Colors] section in config.txt (or add a |
| 108 | [Colors] section to ~/.idle). |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 109 | |
| 110 | Python syntax colors: |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 111 | |
| 112 | Keywords orange |
| 113 | Strings green |
| 114 | Comments red |
| 115 | Definitions blue |
| 116 | |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 117 | Shell colors: |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 118 | |
Guido van Rossum | dd0d335 | 1999-01-09 21:57:56 +0000 | [diff] [blame] | 119 | Console output brown |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 120 | stdout blue |
| 121 | stderr dark green |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 122 | stdin black |
| 123 | |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 124 | Other preferences: |
| 125 | |
Guido van Rossum | 342d8f7 | 2001-10-08 22:49:12 +0000 | [diff] [blame] | 126 | Most preferences can be changed by editing one of the |
| 127 | configuration text files: config.txt (generic) or one of |
| 128 | config-unix.txt, config-win.txt, config.mac.txt (platform |
| 129 | specific). User-specific preferences can be stored in |
| 130 | $HOME/.idle, which overrides the config*.txt files. |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 131 | |
Guido van Rossum | 06b787b | 1999-04-22 23:20:17 +0000 | [diff] [blame] | 132 | To change keyboard bindings, edit Bindings.py |
| 133 | |
| 134 | Command line usage: |
| 135 | |
| 136 | idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ... |
| 137 | |
| 138 | -c command run this command |
| 139 | -d enable debugger |
| 140 | -e edit mode; arguments are files to be edited |
| 141 | -s run $IDLESTARTUP or $PYTHONSTARTUP first |
| 142 | -t title set title of shell window |
| 143 | |
| 144 | If there are arguments: |
| 145 | |
| 146 | If -e is used, arguments are files opened for editing and |
| 147 | sys.argv reflects the arguments passed to IDLE itself. |
| 148 | |
| 149 | Otherwise, if -c is used, all arguments are placed in |
| 150 | sys.argv[1:...], with sys.argv[0] set to '-c'. |
| 151 | |
| 152 | Otherwise, if neither -e nor -c is used, the first |
| 153 | argument is a script which is executed with the remaining |
| 154 | arguments in sys.argv[1:...] and sys.argv[0] set to the |
| 155 | script name. If the script name is '-', no script is |
| 156 | executed but an interactive Python session is started; the |
| 157 | arguments are still available in sys.argv. |