/Lib/idlelib/help.txt

http://unladen-swallow.googlecode.com/ · Plain Text · 285 lines · 224 code · 61 blank · 0 comment · 0 complexity · 79fdf1281a9e7c5948164299eadf84ea MD5 · raw file

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