blob: 6d2ba2fffe0726d27b8d41ac2f56d88cf020eb56 [file] [log] [blame]
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +00001[See the end of this file for ** TIPS ** on using IDLE !!]
David Scherer7aced172000-08-15 01:13:23 +00002
3Click on the dotted line at the top of a menu to "tear it off": a
4separate window containing the menu is created.
5
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +00006File Menu:
David Scherer7aced172000-08-15 01:13:23 +00007
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +00008 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 Scherer7aced172000-08-15 01:13:23 +000015 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000016 Save -- Save current window to the associated file (unsaved
17 windows have a * before and after the window title)
David Scherer7aced172000-08-15 01:13:23 +000018
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000019 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. Kaiser39c7b452002-12-11 04:42:39 +000023 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000024 Print Window -- Print the current window
David Scherer7aced172000-08-15 01:13:23 +000025 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000026 Close -- Close current window (asks to save if unsaved)
27 Exit -- Close all windows, quit (asks to save if unsaved)
David Scherer7aced172000-08-15 01:13:23 +000028
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000029Edit Menu:
David Scherer7aced172000-08-15 01:13:23 +000030
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000031 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 Scherer7aced172000-08-15 01:13:23 +000034 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000035 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 Scherer7aced172000-08-15 01:13:23 +000040 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000041 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 Scherer7aced172000-08-15 01:13:23 +000044 Find in Files... -- Open a search dialog box for searching files
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000045 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. Kaiser39c7b452002-12-11 04:42:39 +000050
51Format Menu (only in Edit window):
52
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000053 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. Kaiser6e4620b2004-03-16 03:36:41 +000058 (Note: We recommend using 4 space blocks to indent Python code.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000059 Untabify Region -- Turn *all* tabs into the right number of spaces
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000060 New Indent Width... -- Open dialog to change indent width
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000061 Format Paragraph -- Reformat the current blank-line-separated
62 paragraph
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000063
64Run Menu (only in Edit window):
65
66 Python Shell -- Open or wake up the Python shell window
David Scherer7aced172000-08-15 01:13:23 +000067 ---
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000068 Check Module -- Run a syntax check on the module
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000069 Run Module -- Execute the current file in the __main__ namespace
David Scherer7aced172000-08-15 01:13:23 +000070
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000071Shell Menu (only in Shell window):
72
73 View Last Restart -- Scroll the shell window to the last restart
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000074 Restart Shell -- Restart the interpreter with a fresh environment
75
76Debug 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. Kaiser1061e722003-01-04 01:43:53 +000080 Debugger (toggle) -- Run commands in the shell under the debugger
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000081 Stack Viewer -- Show the stack traceback of the last exception
Kurt B. Kaiser1061e722003-01-04 01:43:53 +000082 Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
83
84Options Menu:
David Scherer7aced172000-08-15 01:13:23 +000085
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000086 Configure IDLE -- Open a configuration dialog. Fonts, indentation,
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000087 keybindings, and color themes may be altered.
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +000088 Startup Preferences may be set, and Additional Help
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +000089 Souces can be specified.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000090 ---
Kurt B. Kaiserd00587a2004-04-24 03:08:13 +000091 Code Context -- Open a pane at the top of the edit window which
92 shows the block context of the section of code
93 which is scrolling off the top or the window.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +000094
95Windows Menu:
96
97 Zoom Height -- toggles the window between configured size
David Scherer7aced172000-08-15 01:13:23 +000098 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. Kaiser39c7b452002-12-11 04:42:39 +0000104Help Menu:
105
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000106 About IDLE -- Version, copyright, license, credits
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000107 IDLE Readme -- Background discussion and change details
108 ---
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000109 IDLE Help -- Display this file
110 Python Docs -- Access local Python documentation, if
111 installed. Otherwise, access www.python.org.
112 ---
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000113 (Additional Help Sources may be added here)
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000114
Kurt B. Kaiser6fa09112003-01-14 22:06:11 +0000115
116** TIPS **
117==========
118
119Additional Help Sources:
120
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000121 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. Kaiser6fa09112003-01-14 22:06:11 +0000124 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. Kaisereb9637e2003-01-26 04:17:16 +0000131 or removed from the Help menu at any time using Configure IDLE.
David Scherer7aced172000-08-15 01:13:23 +0000132
133Basic editing and navigation:
134
Kurt B. Kaiserdf506ea2005-06-12 04:33:30 +0000135 Backspace deletes char to the left; DEL deletes char to the right.
136 Control-backspace deletes word left, Control-DEL deletes word right.
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000137 Arrow keys and Page Up/Down move around.
138 Control-left/right Arrow moves by words in a strange but useful way.
139 Home/End go to begin/end of line.
140 Control-Home/End go to begin/end of file.
141 Some useful Emacs bindings (Control-a, Control-e, Control-k, etc.)
142 are inherited from Tcl/Tk.
143 Standard Windows bindings may work on that platform.
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000144 Keybindings are selected in the Settings Dialog, look there.
David Scherer7aced172000-08-15 01:13:23 +0000145
146Automatic indentation:
147
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000148 After a block-opening statement, the next line is indented by 4 spaces
149 (in the Python Shell window by one tab). After certain keywords
150 (break, return etc.) the next line is dedented. In leading
151 indentation, Backspace deletes up to 4 spaces if they are there. Tab
152 inserts spaces (in the Python Shell window one tab), number depends on
153 Indent Width. (N.B. Currently tabs are restricted to four spaces due
154 to Tcl/Tk issues.)
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000155
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000156 See also the indent/dedent region commands in the edit menu.
David Scherer7aced172000-08-15 01:13:23 +0000157
158Python Shell window:
159
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000160 Control-c interrupts executing command.
Kurt B. Kaisercca91222003-07-16 03:10:43 +0000161 Control-d sends end-of-file; closes window if typed at >>> prompt
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000162 (this is Control-z on Windows).
David Scherer7aced172000-08-15 01:13:23 +0000163
164 Command history:
165
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000166 Alt-p retrieves previous command matching what you have typed.
167 Alt-n retrieves next.
Kurt B. Kaisercca91222003-07-16 03:10:43 +0000168 (These are Control-p, Control-n on the Mac)
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000169 Return while cursor is on a previous command retrieves that command.
170 Expand word is also useful to reduce typing.
David Scherer7aced172000-08-15 01:13:23 +0000171
Kurt B. Kaisereb9637e2003-01-26 04:17:16 +0000172 Syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000173
174 The coloring is applied in a background "thread", so you may
175 occasionally see uncolorized text. To change the color
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000176 scheme, use the Configure IDLE / Highlighting dialog.
David Scherer7aced172000-08-15 01:13:23 +0000177
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000178 Python default syntax colors:
David Scherer7aced172000-08-15 01:13:23 +0000179
180 Keywords orange
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000181 Builtins royal purple
David Scherer7aced172000-08-15 01:13:23 +0000182 Strings green
183 Comments red
184 Definitions blue
185
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000186 Shell default colors:
David Scherer7aced172000-08-15 01:13:23 +0000187
188 Console output brown
189 stdout blue
Kurt B. Kaiser6e4620b2004-03-16 03:36:41 +0000190 stderr red
David Scherer7aced172000-08-15 01:13:23 +0000191 stdin black
192
193Other preferences:
194
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000195 The font preferences, keybinding, and startup preferences can
196 be changed using the Settings dialog.
David Scherer7aced172000-08-15 01:13:23 +0000197
198Command line usage:
Kurt B. Kaiser39c7b452002-12-11 04:42:39 +0000199
200 Enter idle -h at the command prompt to get a usage message.
Kurt B. Kaiser8f570a72003-05-15 18:52:51 +0000201
202Running without a subprocess:
203
204 If IDLE is started with the -n command line switch it will run in a
205 single process and will not create the subprocess which runs the RPC
206 Python execution server. This can be useful if Python cannot create
207 the subprocess or the RPC socket interface on your platform. However,
208 in this mode user code is not isolated from IDLE itself. Also, the
209 environment is not restarted when Run/Run Module (F5) is selected. If
210 your code has been modified, you must reload() the affected modules and
211 re-import any specific items (e.g. from foo import baz) if the changes
212 are to take effect. For these reasons, it is preferable to run IDLE
213 with the default subprocess if at all possible.