README.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. README.txt: an index to idlelib files and the IDLE menu.
  2. IDLE is Python's Integrated Development and Learning
  3. Environment. The user documentation is part of the Library Reference and
  4. is available in IDLE by selecting Help => IDLE Help. This README documents
  5. idlelib for IDLE developers and curious users.
  6. IDLELIB FILES lists files alphabetically by category,
  7. with a short description of each.
  8. IDLE MENU show the menu tree, annotated with the module
  9. or module object that implements the corresponding function.
  10. This file is descriptive, not prescriptive, and may have errors
  11. and omissions and lag behind changes in idlelib.
  12. IDLELIB FILES
  13. =============
  14. Implementation files not in IDLE MENU are marked (nim).
  15. Startup
  16. -------
  17. __init__.py # import, does nothing
  18. __main__.py # -m, starts IDLE
  19. idle.bat
  20. idle.py
  21. idle.pyw
  22. Implementation
  23. --------------
  24. autocomplete.py # Complete attribute names or filenames.
  25. autocomplete_w.py # Display completions.
  26. autoexpand.py # Expand word with previous word in file.
  27. browser.py # Create module browser window.
  28. calltip.py # Create calltip text.
  29. calltip_w.py # Display calltip.
  30. codecontext.py # Show compound statement headers otherwise not visible.
  31. colorizer.py # Colorize text (nim).
  32. config.py # Load, fetch, and save configuration (nim).
  33. configdialog.py # Display user configuration dialogs.
  34. config_key.py # Change keybindings.
  35. debugger.py # Debug code run from shell or editor; show window.
  36. debugger_r.py # Debug code run in remote process.
  37. debugobj.py # Define class used in stackviewer.
  38. debugobj_r.py # Communicate objects between processes with rpc (nim).
  39. delegator.py # Define base class for delegators (nim).
  40. dynoption.py # Define mutable OptionMenu widget (nim)
  41. editor.py # Define most of editor and utility functions.
  42. filelist.py # Open files and manage list of open windows (nim).
  43. format.py # Define format menu options.
  44. grep.py # Find all occurrences of pattern in multiple files.
  45. help.py # Display IDLE's html doc.
  46. help_about.py # Display About IDLE dialog.
  47. history.py # Get previous or next user input in shell (nim)
  48. hyperparser.py # Parse code around a given index.
  49. iomenu.py # Open, read, and write files
  50. macosx.py # Help IDLE run on Macs (nim).
  51. mainmenu.py # Define most of IDLE menu.
  52. multicall.py # Wrap tk widget to allow multiple calls per event (nim).
  53. outwin.py # Create window for grep output.
  54. parenmatch.py # Match fenceposts: (), [], and {}.
  55. pathbrowser.py # Create path browser window.
  56. percolator.py # Manage delegator stack (nim).
  57. pyparse.py # Give information on code indentation
  58. pyshell.py # Start IDLE, manage shell, complete editor window
  59. query.py # Query user for information
  60. redirector.py # Intercept widget subcommands (for percolator) (nim).
  61. replace.py # Search and replace pattern in text.
  62. rpc.py # Communicate between idle and user processes (nim).
  63. run.py # Manage user code execution subprocess.
  64. runscript.py # Check and run user code.
  65. scrolledlist.py # Define scrolledlist widget for IDLE (nim).
  66. search.py # Search for pattern in text.
  67. searchbase.py # Define base for search, replace, and grep dialogs.
  68. searchengine.py # Define engine for all 3 search dialogs.
  69. sidebar.py # Define line number and shell prompt sidebars.
  70. squeezer.py # Squeeze long shell output (nim).
  71. stackviewer.py # View stack after exception.
  72. statusbar.py # Define status bar for windows (nim).
  73. tabbedpages.py # Define tabbed pages widget (nim).
  74. textview.py # Define read-only text widget (nim).
  75. tooltip.py # Define popups for calltips, squeezer (nim).
  76. tree.py # Define tree widget, used in browsers (nim).
  77. undo.py # Manage undo stack.
  78. util.py # Define common objects imported elsewhere (nim).
  79. windows.py # Manage window list and define listed top level.
  80. zoomheight.py # Zoom window to full height of screen.
  81. zzdummy.py # Example extension.
  82. Configuration
  83. -------------
  84. config-extensions.def # Defaults for extensions
  85. config-highlight.def # Defaults for colorizing
  86. config-keys.def # Defaults for key bindings
  87. config-main.def # Defaults for font and general tabs
  88. Text
  89. ----
  90. CREDITS.txt # not maintained, displayed by About IDLE
  91. HISTORY.txt # NEWS up to July 2001
  92. NEWS.txt # commits, displayed by About IDLE
  93. NEWS2.txt # commits to Python2
  94. README.txt # this file, displayed by About IDLE
  95. TODO.txt # needs review
  96. extend.txt # about writing extensions
  97. help.html # copy of idle.html in docs, displayed by IDLE Help
  98. Subdirectories
  99. --------------
  100. Icons # small image files
  101. idle_test # files for human test and automated unit tests
  102. IDLE MENUS
  103. ==========
  104. Top level items and most submenu items are defined in mainmenu.
  105. Extensions add submenu items when active. The names given are
  106. found, quoted, in one of these modules, paired with a '<<pseudoevent>>'.
  107. Each pseudoevent is bound to an event handler. Some event handlers
  108. call another function that does the actual work. The annotations below
  109. are intended to at least give the module where the actual work is done.
  110. 'eEW' = editor.EditorWindow
  111. File
  112. New File # eEW.new_callback
  113. Open... # iomenu.open
  114. Open Module # eEw.open_module
  115. Recent Files
  116. Class Browser # eEW.open_class_browser, browser.ClassBrowser
  117. Path Browser # eEW.open_path_browser, pathbrowser
  118. ---
  119. Save # iomenu.save
  120. Save As... # iomenu.save_as
  121. Save Copy As... # iomenu.save_a_copy
  122. ---
  123. Print Window # iomenu.print_window
  124. ---
  125. Close # eEW.close_event
  126. Exit # flist.close_all_callback (bound in eEW)
  127. Edit
  128. Undo # undodelegator
  129. Redo # undodelegator
  130. --- # eEW.right_menu_event
  131. Cut # eEW.cut
  132. Copy # eEW.copy
  133. Paste # eEW.past
  134. Select All # eEW.select_all (+ see eEW.remove_selection)
  135. --- # Next 5 items use searchengine; dialogs use searchbase
  136. Find # eEW.find_event, search.SearchDialog.find
  137. Find Again # eEW.find_again_event, sSD.find_again
  138. Find Selection # eEW.find_selection_event, sSD.find_selection
  139. Find in Files... # eEW.find_in_files_event, grep
  140. Replace... # eEW.replace_event, replace.ReplaceDialog.replace
  141. Go to Line # eEW.goto_line_event
  142. Show Completions # autocomplete extension and autocompleteWidow (&HP)
  143. Expand Word # autoexpand extension
  144. Show call tip # Calltips extension and CalltipWindow (& Hyperparser)
  145. Show surrounding parens # parenmatch (& Hyperparser)
  146. Format (Editor only) [fFR = format.FormatRegion]
  147. Format Paragraph # format.FormatParagraph.format_paragraph_event
  148. Indent Region # fFR.indent_region_event
  149. Dedent Region # fFR.dedent_region_event
  150. Comment Out Reg. # fFR.comment_region_event
  151. Uncomment Region # fFR.uncomment_region_event
  152. Tabify Region # fFR.tabify_region_event
  153. Untabify Region # fFR.untabify_region_event
  154. Toggle Tabs # format.Indents.toggle_tabs_event
  155. New Indent Width # format.Indents.change_indentwidth_event
  156. Strip tailing whitespace # format.rstrip
  157. Zin # zzdummy
  158. Zout # zzdummy
  159. Run (Editor only)
  160. Run Module # runscript.ScriptBinding.run_module_event
  161. Run... Customized # runscript.ScriptBinding.run_custom_event
  162. Check Module # runscript.ScriptBinding.check_module_event
  163. Python Shell # pyshell.Pyshell, pyshell.ModifiedInterpreter
  164. Shell # pyshell
  165. View Last Restart # pyshell.PyShell.view_restart_mark
  166. Restart Shell # pyshell.PyShell.restart_shell
  167. Previous History # history.History.history_prev
  168. Next History # history.History.history_next
  169. Interrupt Execution # pyshell.PyShell.cancel_callback
  170. Debug (Shell only)
  171. Go to File/Line # outwin.OutputWindow.goto_file_line
  172. debugger # debugger, debugger_r, PyShell.toggle_debugger
  173. Stack Viewer # stackviewer, PyShell.open_stack_viewer
  174. Auto-open Stack Viewer # stackviewer
  175. Options
  176. Configure IDLE # eEW.config_dialog, config, configdialog (cd)
  177. (Parts of the dialog)
  178. Buttons # cd.ConfigDialog
  179. Font tab # cd.FontPage, config-main.def
  180. Highlight tab # cd.HighPage, query, config-highlight.def
  181. Keys tab # cd.KeysPage, query, config_key, config_keys.def
  182. Windows tab # cd.WinPage, config_main.def
  183. Shell/Ed tab # cd.ShedPage, config-main.def
  184. Extensions tab # config-extensions.def, corresponding .py files
  185. ---
  186. ... Code Context # codecontext
  187. ... Line Numbers # sidebar
  188. Zoomheight # zoomheight
  189. Window
  190. <open windows> # windows
  191. Help
  192. About IDLE # eEW.about_dialog, help_about.AboutDialog
  193. ---
  194. IDLE Help # eEW.help_dialog, help.show_idlehelp
  195. Python Docs # eEW.python_docs
  196. Turtle Demo # eEW.open_turtle_demo
  197. ---
  198. <other help sources>
  199. <Context Menu> (right click)
  200. Defined in editor, PyShell.pyshell
  201. Cut
  202. Copy
  203. Paste
  204. ---
  205. Go to file/line (shell and output only)
  206. Set Breakpoint (editor only)
  207. Clear Breakpoint (editor only)
  208. Defined in debugger
  209. Go to source line
  210. Show stack frame
  211. <No menu>
  212. Center Insert # eEW.center_insert_event
  213. OTHER TOPICS
  214. ============
  215. Generally use PEP 8.
  216. import statements
  217. -----------------
  218. Put imports at the top, unless there is a good reason otherwise.
  219. PEP 8 says to group stdlib, 3rd-party dependencies, and package imports.
  220. For idlelib, the groups are general stdlib, tkinter, and idlelib.
  221. Sort modules within each group, except that tkinter.ttk follows tkinter.
  222. Sort 'from idlelib import mod1' and 'from idlelib.mod2 import object'
  223. together by module, ignoring within module objects.
  224. Put 'import __main__' after other idlelib imports.
  225. Imports only needed for testing are put not at the top but in an
  226. htest function def or "if __name__ == '__main__'" clause.
  227. Within module imports like "from idlelib.mod import class" may cause
  228. circular imports to deadlock. Even without this, circular imports may
  229. require at least one of the imports to be delayed until a function call.
  230. What's New entries
  231. ------------------
  232. Repository directory Doc/whatsnew/ has a file 3.n.rst for each 3.n
  233. Python version. For the first entry in each file, add subsection
  234. 'IDLE and idlelib', in alphabetical position, to the 'Improved Modules'
  235. section. For the rest of cpython, entries to 3.(n+1).rst begin with
  236. the release of 3.n.0b1. For IDLE, entries for features backported from
  237. 'main' to '3.n' during its beta period do not got in 3.(n+1).rst. The
  238. latter usually gets its first entry during the 3.n.0 candidate period
  239. or after the 3.n.0 release.
  240. When, as per PEP 434, feature changes are backported, entries are placed
  241. in the 3.n.rst file *in the main branch* for each Python version n that
  242. gets the backport. (Note: the format of entries have varied between
  243. versions.) Add a line "New in 3.n maintenance releases." before the
  244. first back-ported feature after 3.n.0 is released. Since each older
  245. version file gets a different number of backports, it is easiest to
  246. make a separate PR for each file and label it with the backports
  247. needed.
  248. Github repository and issues
  249. ----------------------------
  250. The CPython repository is https://github.com/python/cpython. The
  251. IDLE Issues listing is https://github.com/orgs/python/projects/31.
  252. The main classification is by Topic, based on the IDLE menu. View the
  253. topics list by clicking the [<]] button in the upper right.