help.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. This file, idlelib/help.txt is out-of-date and no longer used by Idle.
  2. It is deprecated and will be removed in the future, possibly in 3.6
  3. ----------------------------------------------------------------------
  4. [See the end of this file for ** TIPS ** on using IDLE !!]
  5. File Menu:
  6. New File -- Create a new editing window
  7. Open... -- Open an existing file
  8. Recent Files... -- Open a list of recent files
  9. Open Module... -- Open an existing module (searches sys.path)
  10. Class Browser -- Show classes and methods in current file
  11. Path Browser -- Show sys.path directories, modules, classes
  12. and methods
  13. ---
  14. Save -- Save current window to the associated file (unsaved
  15. windows have a * before and after the window title)
  16. Save As... -- Save current window to new file, which becomes
  17. the associated file
  18. Save Copy As... -- Save current window to different file
  19. without changing the associated file
  20. ---
  21. Print Window -- Print the current window
  22. ---
  23. Close -- Close current window (asks to save if unsaved)
  24. Exit -- Close all windows, quit (asks to save if unsaved)
  25. Edit Menu:
  26. Undo -- Undo last change to current window
  27. (A maximum of 1000 changes may be undone)
  28. Redo -- Redo last undone change to current window
  29. ---
  30. Cut -- Copy a selection into system-wide clipboard,
  31. then delete the selection
  32. Copy -- Copy selection into system-wide clipboard
  33. Paste -- Insert system-wide clipboard into window
  34. Select All -- Select the entire contents of the edit buffer
  35. ---
  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
  41. Go to Line -- Ask for a line number and show that line
  42. Show Calltip -- Open a small window with function param hints
  43. Show Completions -- Open a scroll window allowing selection keywords
  44. and attributes. (see '*TIPS*', below)
  45. Show Parens -- Highlight the surrounding parenthesis
  46. Expand Word -- Expand the word you have typed to match another
  47. word in the same buffer; repeat to get a
  48. different expansion
  49. Format Menu (only in Edit window):
  50. Indent Region -- Shift selected lines right 4 spaces
  51. Dedent Region -- Shift selected lines left 4 spaces
  52. Comment Out Region -- Insert ## in front of selected lines
  53. Uncomment Region -- Remove leading # or ## from selected lines
  54. Tabify Region -- Turns *leading* stretches of spaces into tabs
  55. (Note: We recommend using 4 space blocks to indent Python code.)
  56. Untabify Region -- Turn *all* tabs into the right number of spaces
  57. New Indent Width... -- Open dialog to change indent width
  58. Format Paragraph -- Reformat the current blank-line-separated
  59. paragraph
  60. Run Menu (only in Edit window):
  61. Python Shell -- Open or wake up the Python shell window
  62. ---
  63. Check Module -- Run a syntax check on the module
  64. Run Module -- Execute the current file in the __main__ namespace
  65. Shell Menu (only in Shell window):
  66. View Last Restart -- Scroll the shell window to the last restart
  67. Restart Shell -- Restart the interpreter with a fresh environment
  68. Debug Menu (only in Shell window):
  69. Go to File/Line -- look around the insert point for a filename
  70. and line number, open the file, and show the line
  71. Debugger (toggle) -- Run commands in the shell under the debugger
  72. Stack Viewer -- Show the stack traceback of the last exception
  73. Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
  74. Options Menu:
  75. Configure IDLE -- Open a configuration dialog. Fonts, indentation,
  76. keybindings, and color themes may be altered.
  77. Startup Preferences may be set, and Additional Help
  78. Sources can be specified. On OS X, open the
  79. configuration dialog by selecting Preferences
  80. in the application menu.
  81. ---
  82. Code Context -- Open a pane at the top of the edit window which
  83. shows the block context of the section of code
  84. which is scrolling off the top or the window.
  85. (Not present in Shell window.)
  86. Window Menu:
  87. Zoom Height -- toggles the window between configured size
  88. and maximum height.
  89. ---
  90. The rest of this menu lists the names of all open windows;
  91. select one to bring it to the foreground (deiconifying it if
  92. necessary).
  93. Help Menu:
  94. About IDLE -- Version, copyright, license, credits
  95. IDLE Readme -- Background discussion and change details
  96. ---
  97. IDLE Help -- Display this file
  98. Python Docs -- Access local Python documentation, if
  99. installed. Otherwise, access www.python.org.
  100. ---
  101. (Additional Help Sources may be added here)
  102. Edit context menu (Right-click / Control-click on OS X in Edit window):
  103. Cut -- Copy a selection into system-wide clipboard,
  104. then delete the selection
  105. Copy -- Copy selection into system-wide clipboard
  106. Paste -- Insert system-wide clipboard into window
  107. Set Breakpoint -- Sets a breakpoint (when debugger open)
  108. Clear Breakpoint -- Clears the breakpoint on that line
  109. Shell context menu (Right-click / Control-click on OS X in Shell window):
  110. Cut -- Copy a selection into system-wide clipboard,
  111. then delete the selection
  112. Copy -- Copy selection into system-wide clipboard
  113. Paste -- Insert system-wide clipboard into window
  114. ---
  115. Go to file/line -- Same as in Debug menu
  116. ** TIPS **
  117. ==========
  118. Additional Help Sources:
  119. Windows users can Google on zopeshelf.chm to access Zope help files in
  120. the Windows help format. The Additional Help Sources feature of the
  121. configuration GUI supports .chm, along with any other filetypes
  122. supported by your browser. Supply a Menu Item title, and enter the
  123. location in the Help File Path slot of the New Help Source dialog. Use
  124. http:// and/or www. to identify external URLs, or download the file and
  125. browse for its path on your machine using the Browse button.
  126. All users can access the extensive sources of help, including
  127. tutorials, available at www.python.org/doc. Selected URLs can be added
  128. or removed from the Help menu at any time using Configure IDLE.
  129. Basic editing and navigation:
  130. Backspace deletes char to the left; DEL deletes char to the right.
  131. Control-backspace deletes word left, Control-DEL deletes word right.
  132. Arrow keys and Page Up/Down move around.
  133. Control-left/right Arrow moves by words in a strange but useful way.
  134. Home/End go to begin/end of line.
  135. Control-Home/End go to begin/end of file.
  136. Some useful Emacs bindings are inherited from Tcl/Tk:
  137. Control-a beginning of line
  138. Control-e end of line
  139. Control-k kill line (but doesn't put it in clipboard)
  140. Control-l center window around the insertion point
  141. Standard Windows bindings may work on that platform.
  142. Keybindings are selected in the Settings Dialog, look there.
  143. Automatic indentation:
  144. After a block-opening statement, the next line is indented by 4 spaces
  145. (in the Python Shell window by one tab). After certain keywords
  146. (break, return etc.) the next line is dedented. In leading
  147. indentation, Backspace deletes up to 4 spaces if they are there. Tab
  148. inserts spaces (in the Python Shell window one tab), number depends on
  149. Indent Width. (N.B. Currently tabs are restricted to four spaces due
  150. to Tcl/Tk issues.)
  151. See also the indent/dedent region commands in the edit menu.
  152. Completions:
  153. Completions are supplied for functions, classes, and attributes of
  154. classes, both built-in and user-defined. Completions are also provided
  155. for filenames.
  156. The AutoCompleteWindow (ACW) will open after a predefined delay
  157. (default is two seconds) after a '.' or (in a string) an os.sep is
  158. typed. If after one of those characters (plus zero or more other
  159. characters) you type a Tab the ACW will open immediately if a possible
  160. continuation is found.
  161. If there is only one possible completion for the characters entered, a
  162. Tab will supply that completion without opening the ACW.
  163. 'Show Completions' will force open a completions window. In an empty
  164. string, this will contain the files in the current directory. On a
  165. blank line, it will contain the built-in and user-defined functions and
  166. classes in the current name spaces, plus any modules imported. If some
  167. characters have been entered, the ACW will attempt to be more specific.
  168. If string of characters is typed, the ACW selection will jump to the
  169. entry most closely matching those characters. Entering a Tab will cause
  170. the longest non-ambiguous match to be entered in the Edit window or
  171. Shell. Two Tabs in a row will supply the current ACW selection, as
  172. will Return or a double click. Cursor keys, Page Up/Down, mouse
  173. selection, and the scrollwheel all operate on the ACW.
  174. 'Hidden' attributes can be accessed by typing the beginning of hidden
  175. name after a '.'. e.g. '_'. This allows access to modules with
  176. '__all__' set, or to class-private attributes.
  177. Completions and the 'Expand Word' facility can save a lot of typing!
  178. Completions are currently limited to those in the namespaces. Names in
  179. an Edit window which are not via __main__ or sys.modules will not be
  180. found. Run the module once with your imports to correct this
  181. situation. Note that IDLE itself places quite a few modules in
  182. sys.modules, so much can be found by default, e.g. the re module.
  183. If you don't like the ACW popping up unbidden, simply make the delay
  184. longer or disable the extension. OTOH, you could make the delay zero.
  185. You could also switch off the CallTips extension. (We will be adding
  186. a delay to the call tip window.)
  187. Python Shell window:
  188. Control-c interrupts executing command.
  189. Control-d sends end-of-file; closes window if typed at >>> prompt.
  190. Command history:
  191. Alt-p retrieves previous command matching what you have typed.
  192. Alt-n retrieves next.
  193. (These are Control-p, Control-n on OS X)
  194. Return while cursor is on a previous command retrieves that command.
  195. Expand word is also useful to reduce typing.
  196. Syntax colors:
  197. The coloring is applied in a background "thread", so you may
  198. occasionally see uncolorized text. To change the color
  199. scheme, use the Configure IDLE / Highlighting dialog.
  200. Python default syntax colors:
  201. Keywords orange
  202. Builtins royal purple
  203. Strings green
  204. Comments red
  205. Definitions blue
  206. Shell default colors:
  207. Console output brown
  208. stdout blue
  209. stderr red
  210. stdin black
  211. Other preferences:
  212. The font preferences, keybinding, and startup preferences can
  213. be changed using the Settings dialog.
  214. Command line usage:
  215. Enter idle -h at the command prompt to get a usage message.
  216. Running without a subprocess:
  217. If IDLE is started with the -n command line switch it will run in a
  218. single process and will not create the subprocess which runs the RPC
  219. Python execution server. This can be useful if Python cannot create
  220. the subprocess or the RPC socket interface on your platform. However,
  221. in this mode user code is not isolated from IDLE itself. Also, the
  222. environment is not restarted when Run/Run Module (F5) is selected. If
  223. your code has been modified, you must reload() the affected modules and
  224. re-import any specific items (e.g. from foo import baz) if the changes
  225. are to take effect. For these reasons, it is preferable to run IDLE
  226. with the default subprocess if at all possible.
  227. Extensions:
  228. IDLE contains an extension facility. See the beginning of
  229. config-extensions.def in the idlelib directory for further information.
  230. The default extensions are currently:
  231. FormatParagraph
  232. AutoExpand
  233. ZoomHeight
  234. ScriptBinding
  235. CallTips
  236. ParenMatch
  237. AutoComplete
  238. CodeContext