1<!DOCTYPE html> 2 3<html lang="en"> 4 <head> 5 <meta charset="utf-8" /> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> 7 8 <title>IDLE — Python 3.14.0a0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0"> 9 10 <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> 11 <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" /> 12 <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" /> 13 14 <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> 15 <script src="../_static/doctools.js"></script> 16 <script src="../_static/sphinx_highlight.js"></script> 17 18 <script src="../_static/sidebar.js"></script> 19 20 <link rel="search" type="application/opensearchdescription+xml" 21 title="Search within Python 3.14.0a0 documentation" 22 href="../_static/opensearch.xml"/> 23 <link rel="author" title="About these documents" href="../about.html" /> 24 <link rel="index" title="Index" href="../genindex.html" /> 25 <link rel="search" title="Search" href="../search.html" /> 26 <link rel="copyright" title="Copyright" href="../copyright.html" /> 27 <link rel="next" title="Development Tools" href="development.html" /> 28 <link rel="prev" title="tkinter.ttk — Tk themed widgets" href="tkinter.ttk.html" /> 29 30 <link rel="canonical" href="https://docs.python.org/3/library/idle.html" /> 31 32 33 34 35 36 <style> 37 @media only screen { 38 table.full-width-table { 39 width: 100%; 40 } 41 } 42 </style> 43<link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css"> 44 <link rel="shortcut icon" type="image/png" href="../_static/py.svg" /> 45 <script type="text/javascript" src="../_static/copybutton.js"></script> 46 <script type="text/javascript" src="../_static/menu.js"></script> 47 <script type="text/javascript" src="../_static/search-focus.js"></script> 48 <script type="text/javascript" src="../_static/themetoggle.js"></script> 49 <script type="text/javascript" src="../_static/rtd_switcher.js"></script> 50 <meta name="readthedocs-addons-api-version" content="1"> 51 52 </head> 53<body> 54<div class="mobile-nav"> 55 <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation" 56 aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" /> 57 <nav class="nav-content" role="navigation"> 58 <label for="menuToggler" class="toggler__label"> 59 <span></span> 60 </label> 61 <span class="nav-items-wrapper"> 62 <a href="https://www.python.org/" class="nav-logo"> 63 <img src="../_static/py.svg" alt="Logo"/> 64 </a> 65 <span class="version_switcher_placeholder"></span> 66 <form role="search" class="search" action="../search.html" method="get"> 67 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon"> 68 <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path> 69 </svg> 70 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" /> 71 <input type="submit" value="Go"/> 72 </form> 73 </span> 74 </nav> 75 <div class="menu-wrapper"> 76 <nav class="menu" role="navigation" aria-label="main navigation"> 77 <div class="language_switcher_placeholder"></div> 78 79<label class="theme-selector-label"> 80 Theme 81 <select class="theme-selector" oninput="activateTheme(this.value)"> 82 <option value="auto" selected>Auto</option> 83 <option value="light">Light</option> 84 <option value="dark">Dark</option> 85 </select> 86</label> 87 <div> 88 <h3><a href="../contents.html">Table of Contents</a></h3> 89 <ul> 90<li><a class="reference internal" href="#">IDLE</a><ul> 91<li><a class="reference internal" href="#menus">Menus</a><ul> 92<li><a class="reference internal" href="#file-menu-shell-and-editor">File menu (Shell and Editor)</a></li> 93<li><a class="reference internal" href="#edit-menu-shell-and-editor">Edit menu (Shell and Editor)</a></li> 94<li><a class="reference internal" href="#format-menu-editor-window-only">Format menu (Editor window only)</a></li> 95<li><a class="reference internal" href="#run-menu-editor-window-only">Run menu (Editor window only)</a></li> 96<li><a class="reference internal" href="#shell-menu-shell-window-only">Shell menu (Shell window only)</a></li> 97<li><a class="reference internal" href="#debug-menu-shell-window-only">Debug menu (Shell window only)</a></li> 98<li><a class="reference internal" href="#options-menu-shell-and-editor">Options menu (Shell and Editor)</a></li> 99<li><a class="reference internal" href="#window-menu-shell-and-editor">Window menu (Shell and Editor)</a></li> 100<li><a class="reference internal" href="#help-menu-shell-and-editor">Help menu (Shell and Editor)</a></li> 101<li><a class="reference internal" href="#context-menus">Context menus</a></li> 102</ul> 103</li> 104<li><a class="reference internal" href="#editing-and-navigation">Editing and Navigation</a><ul> 105<li><a class="reference internal" href="#editor-windows">Editor windows</a></li> 106<li><a class="reference internal" href="#key-bindings">Key bindings</a></li> 107<li><a class="reference internal" href="#automatic-indentation">Automatic indentation</a></li> 108<li><a class="reference internal" href="#search-and-replace">Search and Replace</a></li> 109<li><a class="reference internal" href="#completions">Completions</a></li> 110<li><a class="reference internal" href="#calltips">Calltips</a></li> 111<li><a class="reference internal" href="#code-context">Code Context</a></li> 112<li><a class="reference internal" href="#shell-window">Shell window</a></li> 113<li><a class="reference internal" href="#text-colors">Text colors</a></li> 114</ul> 115</li> 116<li><a class="reference internal" href="#startup-and-code-execution">Startup and Code Execution</a><ul> 117<li><a class="reference internal" href="#command-line-usage">Command line usage</a></li> 118<li><a class="reference internal" href="#startup-failure">Startup failure</a></li> 119<li><a class="reference internal" href="#running-user-code">Running user code</a></li> 120<li><a class="reference internal" href="#user-output-in-shell">User output in Shell</a></li> 121<li><a class="reference internal" href="#developing-tkinter-applications">Developing tkinter applications</a></li> 122<li><a class="reference internal" href="#running-without-a-subprocess">Running without a subprocess</a></li> 123</ul> 124</li> 125<li><a class="reference internal" href="#help-and-preferences">Help and Preferences</a><ul> 126<li><a class="reference internal" href="#help-sources">Help sources</a></li> 127<li><a class="reference internal" href="#setting-preferences">Setting preferences</a></li> 128<li><a class="reference internal" href="#idle-on-macos">IDLE on macOS</a></li> 129<li><a class="reference internal" href="#extensions">Extensions</a></li> 130</ul> 131</li> 132<li><a class="reference internal" href="#module-idlelib">idlelib</a></li> 133</ul> 134</li> 135</ul> 136 137 </div> 138 <div> 139 <h4>Previous topic</h4> 140 <p class="topless"><a href="tkinter.ttk.html" 141 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tkinter.ttk</span></code> — Tk themed widgets</a></p> 142 </div> 143 <div> 144 <h4>Next topic</h4> 145 <p class="topless"><a href="development.html" 146 title="next chapter">Development Tools</a></p> 147 </div> 148 <div role="note" aria-label="source link"> 149 <h3>This Page</h3> 150 <ul class="this-page-menu"> 151 <li><a href="../bugs.html">Report a Bug</a></li> 152 <li> 153 <a href="https://github.com/python/cpython/blob/main/Doc/library/idle.rst" 154 rel="nofollow">Show Source 155 </a> 156 </li> 157 </ul> 158 </div> 159 </nav> 160 </div> 161</div> 162 163 164 <div class="related" role="navigation" aria-label="related navigation"> 165 <h3>Navigation</h3> 166 <ul> 167 <li class="right" style="margin-right: 10px"> 168 <a href="../genindex.html" title="General Index" 169 accesskey="I">index</a></li> 170 <li class="right" > 171 <a href="../py-modindex.html" title="Python Module Index" 172 >modules</a> |</li> 173 <li class="right" > 174 <a href="development.html" title="Development Tools" 175 accesskey="N">next</a> |</li> 176 <li class="right" > 177 <a href="tkinter.ttk.html" title="tkinter.ttk — Tk themed widgets" 178 accesskey="P">previous</a> |</li> 179 180 <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> 181 <li><a href="https://www.python.org/">Python</a> »</li> 182 <li class="switchers"> 183 <div class="language_switcher_placeholder"></div> 184 <div class="version_switcher_placeholder"></div> 185 </li> 186 <li> 187 188 </li> 189 <li id="cpython-language-and-version"> 190 <a href="../index.html">3.14.0a0 Documentation</a> » 191 </li> 192 193 <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> 194 <li class="nav-item nav-item-2"><a href="tk.html" accesskey="U">Graphical User Interfaces with Tk</a> »</li> 195 <li class="nav-item nav-item-this"><a href="">IDLE</a></li> 196 <li class="right"> 197 198 199 <div class="inline-search" role="search"> 200 <form class="inline-search" action="../search.html" method="get"> 201 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" /> 202 <input type="submit" value="Go" /> 203 </form> 204 </div> 205 | 206 </li> 207 <li class="right"> 208<label class="theme-selector-label"> 209 Theme 210 <select class="theme-selector" oninput="activateTheme(this.value)"> 211 <option value="auto" selected>Auto</option> 212 <option value="light">Light</option> 213 <option value="dark">Dark</option> 214 </select> 215</label> |</li> 216 217 </ul> 218 </div> 219 220 <div class="document"> 221 <div class="documentwrapper"> 222 <div class="bodywrapper"> 223 <div class="body" role="main"> 224 225 <section id="idle"> 226<span id="id1"></span><h1>IDLE<a class="headerlink" href="#idle" title="Permalink to this heading">¶</a></h1> 227<p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/main/Lib/idlelib/">Lib/idlelib/</a></p> 228<hr class="docutils" id="index-0" /> 229<p>IDLE is Python’s Integrated Development and Learning Environment.</p> 230<p>IDLE has the following features:</p> 231<ul class="simple"> 232<li><p>cross-platform: works mostly the same on Windows, Unix, and macOS</p></li> 233<li><p>Python shell window (interactive interpreter) with colorizing 234of code input, output, and error messages</p></li> 235<li><p>multi-window text editor with multiple undo, Python colorizing, 236smart indent, call tips, auto completion, and other features</p></li> 237<li><p>search within any window, replace within editor windows, and search 238through multiple files (grep)</p></li> 239<li><p>debugger with persistent breakpoints, stepping, and viewing 240of global and local namespaces</p></li> 241<li><p>configuration, browsers, and other dialogs</p></li> 242</ul> 243<section id="menus"> 244<h2>Menus<a class="headerlink" href="#menus" title="Permalink to this heading">¶</a></h2> 245<p>IDLE has two main window types, the Shell window and the Editor window. It is 246possible to have multiple editor windows simultaneously. On Windows and 247Linux, each has its own top menu. Each menu documented below indicates 248which window type it is associated with.</p> 249<p>Output windows, such as used for Edit => Find in Files, are a subtype of editor 250window. They currently have the same top menu but a different 251default title and context menu.</p> 252<p>On macOS, there is one application menu. It dynamically changes according 253to the window currently selected. It has an IDLE menu, and some entries 254described below are moved around to conform to Apple guidelines.</p> 255<section id="file-menu-shell-and-editor"> 256<h3>File menu (Shell and Editor)<a class="headerlink" href="#file-menu-shell-and-editor" title="Permalink to this heading">¶</a></h3> 257<dl class="simple"> 258<dt>New File</dt><dd><p>Create a new file editing window.</p> 259</dd> 260<dt>Open…</dt><dd><p>Open an existing file with an Open dialog.</p> 261</dd> 262<dt>Open Module…</dt><dd><p>Open an existing module (searches sys.path).</p> 263</dd> 264<dt>Recent Files</dt><dd><p>Open a list of recent files. Click one to open it.</p> 265</dd> 266</dl> 267<dl class="simple" id="index-1"> 268<dt>Module Browser</dt><dd><p>Show functions, classes, and methods in the current Editor file in a 269tree structure. In the shell, open a module first.</p> 270</dd> 271<dt>Path Browser</dt><dd><p>Show sys.path directories, modules, functions, classes and methods in a 272tree structure.</p> 273</dd> 274<dt>Save</dt><dd><p>Save the current window to the associated file, if there is one. Windows 275that have been changed since being opened or last saved have a * before 276and after the window title. If there is no associated file, 277do Save As instead.</p> 278</dd> 279<dt>Save As…</dt><dd><p>Save the current window with a Save As dialog. The file saved becomes the 280new associated file for the window. (If your file namager is set to hide 281extensions, the current extension will be omitted in the file name box. 282If the new filename has no ‘.’, ‘.py’ and ‘.txt’ will be added for Python 283and text files, except that on macOS Aqua,’.py’ is added for all files.)</p> 284</dd> 285<dt>Save Copy As…</dt><dd><p>Save the current window to different file without changing the associated 286file. (See Save As note above about filename extensions.)</p> 287</dd> 288<dt>Print Window</dt><dd><p>Print the current window to the default printer.</p> 289</dd> 290<dt>Close Window</dt><dd><p>Close the current window (if an unsaved editor, ask to save; if an unsaved 291Shell, ask to quit execution). Calling <code class="docutils literal notranslate"><span class="pre">exit()</span></code> or <code class="docutils literal notranslate"><span class="pre">close()</span></code> in the Shell 292window also closes Shell. If this is the only window, also exit IDLE.</p> 293</dd> 294<dt>Exit IDLE</dt><dd><p>Close all windows and quit IDLE (ask to save unsaved edit windows).</p> 295</dd> 296</dl> 297</section> 298<section id="edit-menu-shell-and-editor"> 299<h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and-editor" title="Permalink to this heading">¶</a></h3> 300<dl class="simple"> 301<dt>Undo</dt><dd><p>Undo the last change to the current window. A maximum of 1000 changes may 302be undone.</p> 303</dd> 304<dt>Redo</dt><dd><p>Redo the last undone change to the current window.</p> 305</dd> 306<dt>Select All</dt><dd><p>Select the entire contents of the current window.</p> 307</dd> 308<dt>Cut</dt><dd><p>Copy selection into the system-wide clipboard; then delete the selection.</p> 309</dd> 310<dt>Copy</dt><dd><p>Copy selection into the system-wide clipboard.</p> 311</dd> 312<dt>Paste</dt><dd><p>Insert contents of the system-wide clipboard into the current window.</p> 313</dd> 314</dl> 315<p>The clipboard functions are also available in context menus.</p> 316<dl class="simple"> 317<dt>Find…</dt><dd><p>Open a search dialog with many options</p> 318</dd> 319<dt>Find Again</dt><dd><p>Repeat the last search, if there is one.</p> 320</dd> 321<dt>Find Selection</dt><dd><p>Search for the currently selected string, if there is one.</p> 322</dd> 323<dt>Find in Files…</dt><dd><p>Open a file search dialog. Put results in a new output window.</p> 324</dd> 325<dt>Replace…</dt><dd><p>Open a search-and-replace dialog.</p> 326</dd> 327<dt>Go to Line</dt><dd><p>Move the cursor to the beginning of the line requested and make that 328line visible. A request past the end of the file goes to the end. 329Clear any selection and update the line and column status.</p> 330</dd> 331<dt>Show Completions</dt><dd><p>Open a scrollable list allowing selection of existing names. See 332<a class="reference internal" href="#completions"><span class="std std-ref">Completions</span></a> in the Editing and navigation section below.</p> 333</dd> 334<dt>Expand Word</dt><dd><p>Expand a prefix you have typed to match a full word in the same window; 335repeat to get a different expansion.</p> 336</dd> 337<dt>Show Call Tip</dt><dd><p>After an unclosed parenthesis for a function, open a small window with 338function parameter hints. See <a class="reference internal" href="#calltips"><span class="std std-ref">Calltips</span></a> in the 339Editing and navigation section below.</p> 340</dd> 341<dt>Show Surrounding Parens</dt><dd><p>Highlight the surrounding parenthesis.</p> 342</dd> 343</dl> 344</section> 345<section id="format-menu-editor-window-only"> 346<span id="format-menu"></span><h3>Format menu (Editor window only)<a class="headerlink" href="#format-menu-editor-window-only" title="Permalink to this heading">¶</a></h3> 347<dl class="simple"> 348<dt>Format Paragraph</dt><dd><p>Reformat the current blank-line-delimited paragraph in comment block or 349multiline string or selected line in a string. All lines in the 350paragraph will be formatted to less than N columns, where N defaults to 72.</p> 351</dd> 352<dt>Indent Region</dt><dd><p>Shift selected lines right by the indent width (default 4 spaces).</p> 353</dd> 354<dt>Dedent Region</dt><dd><p>Shift selected lines left by the indent width (default 4 spaces).</p> 355</dd> 356<dt>Comment Out Region</dt><dd><p>Insert ## in front of selected lines.</p> 357</dd> 358<dt>Uncomment Region</dt><dd><p>Remove leading # or ## from selected lines.</p> 359</dd> 360<dt>Tabify Region</dt><dd><p>Turn <em>leading</em> stretches of spaces into tabs. (Note: We recommend using 3614 space blocks to indent Python code.)</p> 362</dd> 363<dt>Untabify Region</dt><dd><p>Turn <em>all</em> tabs into the correct number of spaces.</p> 364</dd> 365<dt>Toggle Tabs</dt><dd><p>Open a dialog to switch between indenting with spaces and tabs.</p> 366</dd> 367<dt>New Indent Width</dt><dd><p>Open a dialog to change indent width. The accepted default by the Python 368community is 4 spaces.</p> 369</dd> 370<dt>Strip Trailing Chitespace</dt><dd><p>Remove trailing space and other whitespace characters after the last 371non-whitespace character of a line by applying str.rstrip to each line, 372including lines within multiline strings. Except for Shell windows, 373remove extra newlines at the end of the file.</p> 374</dd> 375</dl> 376</section> 377<section id="run-menu-editor-window-only"> 378<span id="index-2"></span><h3>Run menu (Editor window only)<a class="headerlink" href="#run-menu-editor-window-only" title="Permalink to this heading">¶</a></h3> 379<dl class="simple" id="run-module"> 380<dt>Run Module</dt><dd><p>Do <a class="reference internal" href="#check-module"><span class="std std-ref">Check Module</span></a>. If no error, restart the shell to clean the 381environment, then execute the module. Output is displayed in the Shell 382window. Note that output requires use of <code class="docutils literal notranslate"><span class="pre">print</span></code> or <code class="docutils literal notranslate"><span class="pre">write</span></code>. 383When execution is complete, the Shell retains focus and displays a prompt. 384At this point, one may interactively explore the result of execution. 385This is similar to executing a file with <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-i</span> <span class="pre">file</span></code> at a command 386line.</p> 387</dd> 388</dl> 389<dl class="simple" id="run-custom"> 390<dt>Run… Customized</dt><dd><p>Same as <a class="reference internal" href="#run-module"><span class="std std-ref">Run Module</span></a>, but run the module with customized 391settings. <em>Command Line Arguments</em> extend <a class="reference internal" href="sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> as if passed 392on a command line. The module can be run in the Shell without restarting.</p> 393</dd> 394</dl> 395<dl class="simple" id="check-module"> 396<dt>Check Module</dt><dd><p>Check the syntax of the module currently open in the Editor window. If the 397module has not been saved IDLE will either prompt the user to save or 398autosave, as selected in the General tab of the Idle Settings dialog. If 399there is a syntax error, the approximate location is indicated in the 400Editor window.</p> 401</dd> 402</dl> 403<dl class="simple" id="python-shell"> 404<dt>Python Shell</dt><dd><p>Open or wake up the Python Shell window.</p> 405</dd> 406</dl> 407</section> 408<section id="shell-menu-shell-window-only"> 409<h3>Shell menu (Shell window only)<a class="headerlink" href="#shell-menu-shell-window-only" title="Permalink to this heading">¶</a></h3> 410<dl class="simple"> 411<dt>View Last Restart</dt><dd><p>Scroll the shell window to the last Shell restart.</p> 412</dd> 413<dt>Restart Shell</dt><dd><p>Restart the shell to clean the environment and reset display and exception handling.</p> 414</dd> 415<dt>Previous History</dt><dd><p>Cycle through earlier commands in history which match the current entry.</p> 416</dd> 417<dt>Next History</dt><dd><p>Cycle through later commands in history which match the current entry.</p> 418</dd> 419<dt>Interrupt Execution</dt><dd><p>Stop a running program.</p> 420</dd> 421</dl> 422</section> 423<section id="debug-menu-shell-window-only"> 424<h3>Debug menu (Shell window only)<a class="headerlink" href="#debug-menu-shell-window-only" title="Permalink to this heading">¶</a></h3> 425<dl class="simple"> 426<dt>Go to File/Line</dt><dd><p>Look on the current line. with the cursor, and the line above for a filename 427and line number. If found, open the file if not already open, and show the 428line. Use this to view source lines referenced in an exception traceback 429and lines found by Find in Files. Also available in the context menu of 430the Shell window and Output windows.</p> 431</dd> 432</dl> 433<dl class="simple" id="index-3"> 434<dt>Debugger (toggle)</dt><dd><p>When activated, code entered in the Shell or run from an Editor will run 435under the debugger. In the Editor, breakpoints can be set with the context 436menu. This feature is still incomplete and somewhat experimental.</p> 437</dd> 438<dt>Stack Viewer</dt><dd><p>Show the stack traceback of the last exception in a tree widget, with 439access to locals and globals.</p> 440</dd> 441<dt>Auto-open Stack Viewer</dt><dd><p>Toggle automatically opening the stack viewer on an unhandled exception.</p> 442</dd> 443</dl> 444</section> 445<section id="options-menu-shell-and-editor"> 446<h3>Options menu (Shell and Editor)<a class="headerlink" href="#options-menu-shell-and-editor" title="Permalink to this heading">¶</a></h3> 447<dl class="simple"> 448<dt>Configure IDLE</dt><dd><p>Open a configuration dialog and change preferences for the following: 449fonts, indentation, keybindings, text color themes, startup windows and 450size, additional help sources, and extensions. On macOS, open the 451configuration dialog by selecting Preferences in the application 452menu. For more details, see 453<a class="reference internal" href="#preferences"><span class="std std-ref">Setting preferences</span></a> under Help and preferences.</p> 454</dd> 455</dl> 456<p>Most configuration options apply to all windows or all future windows. 457The option items below only apply to the active window.</p> 458<dl class="simple"> 459<dt>Show/Hide Code Context (Editor Window only)</dt><dd><p>Open a pane at the top of the edit window which shows the block context 460of the code which has scrolled above the top of the window. See 461<a class="reference internal" href="#code-context"><span class="std std-ref">Code Context</span></a> in the Editing and Navigation section 462below.</p> 463</dd> 464<dt>Show/Hide Line Numbers (Editor Window only)</dt><dd><p>Open a column to the left of the edit window which shows the number 465of each line of text. The default is off, which may be changed in the 466preferences (see <a class="reference internal" href="#preferences"><span class="std std-ref">Setting preferences</span></a>).</p> 467</dd> 468<dt>Zoom/Restore Height</dt><dd><p>Toggles the window between normal size and maximum height. The initial size 469defaults to 40 lines by 80 chars unless changed on the General tab of the 470Configure IDLE dialog. The maximum height for a screen is determined by 471momentarily maximizing a window the first time one is zoomed on the screen. 472Changing screen settings may invalidate the saved height. This toggle has 473no effect when a window is maximized.</p> 474</dd> 475</dl> 476</section> 477<section id="window-menu-shell-and-editor"> 478<h3>Window menu (Shell and Editor)<a class="headerlink" href="#window-menu-shell-and-editor" title="Permalink to this heading">¶</a></h3> 479<p>Lists the names of all open windows; select one to bring it to the foreground 480(deiconifying it if necessary).</p> 481</section> 482<section id="help-menu-shell-and-editor"> 483<h3>Help menu (Shell and Editor)<a class="headerlink" href="#help-menu-shell-and-editor" title="Permalink to this heading">¶</a></h3> 484<dl class="simple"> 485<dt>About IDLE</dt><dd><p>Display version, copyright, license, credits, and more.</p> 486</dd> 487<dt>IDLE Help</dt><dd><p>Display this IDLE document, detailing the menu options, basic editing and 488navigation, and other tips.</p> 489</dd> 490<dt>Python Docs</dt><dd><p>Access local Python documentation, if installed, or start a web browser 491and open docs.python.org showing the latest Python documentation.</p> 492</dd> 493<dt>Turtle Demo</dt><dd><p>Run the turtledemo module with example Python code and turtle drawings.</p> 494</dd> 495</dl> 496<p>Additional help sources may be added here with the Configure IDLE dialog under 497the General tab. See the <a class="reference internal" href="#help-sources"><span class="std std-ref">Help sources</span></a> subsection below 498for more on Help menu choices.</p> 499</section> 500<section id="context-menus"> 501<span id="index-4"></span><h3>Context menus<a class="headerlink" href="#context-menus" title="Permalink to this heading">¶</a></h3> 502<p>Open a context menu by right-clicking in a window (Control-click on macOS). 503Context menus have the standard clipboard functions also on the Edit menu.</p> 504<dl class="simple"> 505<dt>Cut</dt><dd><p>Copy selection into the system-wide clipboard; then delete the selection.</p> 506</dd> 507<dt>Copy</dt><dd><p>Copy selection into the system-wide clipboard.</p> 508</dd> 509<dt>Paste</dt><dd><p>Insert contents of the system-wide clipboard into the current window.</p> 510</dd> 511</dl> 512<p>Editor windows also have breakpoint functions. Lines with a breakpoint set are 513specially marked. Breakpoints only have an effect when running under the 514debugger. Breakpoints for a file are saved in the user’s <code class="docutils literal notranslate"><span class="pre">.idlerc</span></code> 515directory.</p> 516<dl class="simple"> 517<dt>Set Breakpoint</dt><dd><p>Set a breakpoint on the current line.</p> 518</dd> 519<dt>Clear Breakpoint</dt><dd><p>Clear the breakpoint on that line.</p> 520</dd> 521</dl> 522<p>Shell and Output windows also have the following.</p> 523<dl class="simple"> 524<dt>Go to file/line</dt><dd><p>Same as in Debug menu.</p> 525</dd> 526</dl> 527<p>The Shell window also has an output squeezing facility explained in the <em>Python 528Shell window</em> subsection below.</p> 529<dl class="simple"> 530<dt>Squeeze</dt><dd><p>If the cursor is over an output line, squeeze all the output between 531the code above and the prompt below down to a ‘Squeezed text’ label.</p> 532</dd> 533</dl> 534</section> 535</section> 536<section id="editing-and-navigation"> 537<span id="id2"></span><h2>Editing and Navigation<a class="headerlink" href="#editing-and-navigation" title="Permalink to this heading">¶</a></h2> 538<section id="editor-windows"> 539<h3>Editor windows<a class="headerlink" href="#editor-windows" title="Permalink to this heading">¶</a></h3> 540<p>IDLE may open editor windows when it starts, depending on settings 541and how you start IDLE. Thereafter, use the File menu. There can be only 542one open editor window for a given file.</p> 543<p>The title bar contains the name of the file, the full path, and the version 544of Python and IDLE running the window. The status bar contains the line 545number (‘Ln’) and column number (‘Col’). Line numbers start with 1; 546column numbers with 0.</p> 547<p>IDLE assumes that files with a known .py* extension contain Python code 548and that other files do not. Run Python code with the Run menu.</p> 549</section> 550<section id="key-bindings"> 551<h3>Key bindings<a class="headerlink" href="#key-bindings" title="Permalink to this heading">¶</a></h3> 552<p>The IDLE insertion cursor is a thin vertical bar between character 553positions. When characters are entered, the insertion cursor and 554everything to its right moves right one character and 555the new character is entered in the new space.</p> 556<p>Several non-character keys move the cursor and possibly 557delete characters. Deletion does not puts text on the clipboard, 558but IDLE has an undo list. Wherever this doc discusses keys, 559‘C’ refers to the <kbd class="kbd docutils literal notranslate">Control</kbd> key on Windows and 560Unix and the <kbd class="kbd docutils literal notranslate">Command</kbd> key on macOS. (And all such discussions 561assume that the keys have not been re-bound to something else.)</p> 562<ul class="simple"> 563<li><p>Arrow keys move the cursor one character or line.</p></li> 564<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">LeftArrow</kbd></kbd> and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">RightArrow</kbd></kbd> moves left or right one word.</p></li> 565<li><p><kbd class="kbd docutils literal notranslate">Home</kbd> and <kbd class="kbd docutils literal notranslate">End</kbd> go to the beginning or end of the line.</p></li> 566<li><p><kbd class="kbd docutils literal notranslate">Page Up</kbd> and <kbd class="kbd docutils literal notranslate">Page Down</kbd> go up or down one screen.</p></li> 567<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">Home</kbd></kbd> and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">End</kbd></kbd> go to beginning or end of the file.</p></li> 568<li><p><kbd class="kbd docutils literal notranslate">Backspace</kbd> and <kbd class="kbd docutils literal notranslate">Del</kbd> (or <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">d</kbd></kbd>) delete the previous 569or next character.</p></li> 570<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">Backspace</kbd></kbd> and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">Del</kbd></kbd> delete one word left or right.</p></li> 571<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">k</kbd></kbd> deletes (‘kills’) everything to the right.</p></li> 572</ul> 573<p>Standard keybindings (like <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">c</kbd></kbd> to copy and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">v</kbd></kbd> to paste) 574may work. Keybindings are selected in the Configure IDLE dialog.</p> 575</section> 576<section id="automatic-indentation"> 577<h3>Automatic indentation<a class="headerlink" href="#automatic-indentation" title="Permalink to this heading">¶</a></h3> 578<p>After a block-opening statement, the next line is indented by 4 spaces (in the 579Python Shell window by one tab). After certain keywords (break, return etc.) 580the next line is dedented. In leading indentation, <kbd class="kbd docutils literal notranslate">Backspace</kbd> deletes up 581to 4 spaces if they are there. <kbd class="kbd docutils literal notranslate">Tab</kbd> inserts spaces (in the Python 582Shell window one tab), number depends on Indent width. Currently, tabs 583are restricted to four spaces due to Tcl/Tk limitations.</p> 584<p>See also the indent/dedent region commands on the 585<a class="reference internal" href="#format-menu"><span class="std std-ref">Format menu</span></a>.</p> 586</section> 587<section id="search-and-replace"> 588<h3>Search and Replace<a class="headerlink" href="#search-and-replace" title="Permalink to this heading">¶</a></h3> 589<p>Any selection becomes a search target. However, only selections within 590a line work because searches are only performed within lines with the 591terminal newline removed. If <code class="docutils literal notranslate"><span class="pre">[x]</span> <span class="pre">Regular</span> <span class="pre">expression</span></code> is checked, the 592target is interpreted according to the Python re module.</p> 593</section> 594<section id="completions"> 595<span id="id3"></span><h3>Completions<a class="headerlink" href="#completions" title="Permalink to this heading">¶</a></h3> 596<p>Completions are supplied, when requested and available, for module 597names, attributes of classes or functions, or filenames. Each request 598method displays a completion box with existing names. (See tab 599completions below for an exception.) For any box, change the name 600being completed and the item highlighted in the box by 601typing and deleting characters; by hitting <kbd class="kbd docutils literal notranslate">Up</kbd>, <kbd class="kbd docutils literal notranslate">Down</kbd>, 602<kbd class="kbd docutils literal notranslate">PageUp</kbd>, <kbd class="kbd docutils literal notranslate">PageDown</kbd>, <kbd class="kbd docutils literal notranslate">Home</kbd>, and <kbd class="kbd docutils literal notranslate">End</kbd> keys; 603and by a single click within the box. Close the box with <kbd class="kbd docutils literal notranslate">Escape</kbd>, 604<kbd class="kbd docutils literal notranslate">Enter</kbd>, and double <kbd class="kbd docutils literal notranslate">Tab</kbd> keys or clicks outside the box. 605A double click within the box selects and closes.</p> 606<p>One way to open a box is to type a key character and wait for a 607predefined interval. This defaults to 2 seconds; customize it 608in the settings dialog. (To prevent auto popups, set the delay to a 609large number of milliseconds, such as 100000000.) For imported module 610names or class or function attributes, type ‘.’. 611For filenames in the root directory, type <a class="reference internal" href="os.html#os.sep" title="os.sep"><code class="xref py py-data docutils literal notranslate"><span class="pre">os.sep</span></code></a> or 612<a class="reference internal" href="os.html#os.altsep" title="os.altsep"><code class="xref py py-data docutils literal notranslate"><span class="pre">os.altsep</span></code></a> immediately after an opening quote. (On Windows, 613one can specify a drive first.) Move into subdirectories by typing a 614directory name and a separator.</p> 615<p>Instead of waiting, or after a box is closed, open a completion box 616immediately with Show Completions on the Edit menu. The default hot 617key is <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">space</kbd></kbd>. If one types a prefix for the desired name 618before opening the box, the first match or near miss is made visible. 619The result is the same as if one enters a prefix 620after the box is displayed. Show Completions after a quote completes 621filenames in the current directory instead of a root directory.</p> 622<p>Hitting <kbd class="kbd docutils literal notranslate">Tab</kbd> after a prefix usually has the same effect as Show 623Completions. (With no prefix, it indents.) However, if there is only 624one match to the prefix, that match is immediately added to the editor 625text without opening a box.</p> 626<p>Invoking ‘Show Completions’, or hitting <kbd class="kbd docutils literal notranslate">Tab</kbd> after a prefix, 627outside of a string and without a preceding ‘.’ opens a box with 628keywords, builtin names, and available module-level names.</p> 629<p>When editing code in an editor (as oppose to Shell), increase the 630available module-level names by running your code 631and not restarting the Shell thereafter. This is especially useful 632after adding imports at the top of a file. This also increases 633possible attribute completions.</p> 634<p>Completion boxes initially exclude names beginning with ‘_’ or, for 635modules, not included in ‘__all__’. The hidden names can be accessed 636by typing ‘_’ after ‘.’, either before or after the box is opened.</p> 637</section> 638<section id="calltips"> 639<span id="id4"></span><h3>Calltips<a class="headerlink" href="#calltips" title="Permalink to this heading">¶</a></h3> 640<p>A calltip is shown automatically when one types <kbd class="kbd docutils literal notranslate">(</kbd> after the name 641of an <em>accessible</em> function. A function name expression may include 642dots and subscripts. A calltip remains until it is clicked, the cursor 643is moved out of the argument area, or <kbd class="kbd docutils literal notranslate">)</kbd> is typed. Whenever the 644cursor is in the argument part of a definition, select Edit and “Show 645Call Tip” on the menu or enter its shortcut to display a calltip.</p> 646<p>The calltip consists of the function’s signature and docstring up to 647the latter’s first blank line or the fifth non-blank line. (Some builtin 648functions lack an accessible signature.) A ‘/’ or ‘*’ in the signature 649indicates that the preceding or following arguments are passed by 650position or name (keyword) only. Details are subject to change.</p> 651<p>In Shell, the accessible functions depends on what modules have been 652imported into the user process, including those imported by Idle itself, 653and which definitions have been run, all since the last restart.</p> 654<p>For example, restart the Shell and enter <code class="docutils literal notranslate"><span class="pre">itertools.count(</span></code>. A calltip 655appears because Idle imports itertools into the user process for its own 656use. (This could change.) Enter <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code> and nothing appears. 657Idle does not itself import turtle. The menu entry and shortcut also do 658nothing. Enter <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">turtle</span></code>. Thereafter, <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code> 659will display a calltip.</p> 660<p>In an editor, import statements have no effect until one runs the file. 661One might want to run a file after writing import statements, after 662adding function definitions, or after opening an existing file.</p> 663</section> 664<section id="code-context"> 665<span id="id5"></span><h3>Code Context<a class="headerlink" href="#code-context" title="Permalink to this heading">¶</a></h3> 666<p>Within an editor window containing Python code, code context can be toggled 667in order to show or hide a pane at the top of the window. When shown, this 668pane freezes the opening lines for block code, such as those beginning with 669<code class="docutils literal notranslate"><span class="pre">class</span></code>, <code class="docutils literal notranslate"><span class="pre">def</span></code>, or <code class="docutils literal notranslate"><span class="pre">if</span></code> keywords, that would have otherwise scrolled 670out of view. The size of the pane will be expanded and contracted as needed 671to show the all current levels of context, up to the maximum number of 672lines defined in the Configure IDLE dialog (which defaults to 15). If there 673are no current context lines and the feature is toggled on, a single blank 674line will display. Clicking on a line in the context pane will move that 675line to the top of the editor.</p> 676<p>The text and background colors for the context pane can be configured under 677the Highlights tab in the Configure IDLE dialog.</p> 678</section> 679<section id="shell-window"> 680<h3>Shell window<a class="headerlink" href="#shell-window" title="Permalink to this heading">¶</a></h3> 681<p>In IDLE’s Shell, enter, edit, and recall complete statements. (Most 682consoles and terminals only work with a single physical line at a time).</p> 683<p>Submit a single-line statement for execution by hitting <kbd class="kbd docutils literal notranslate">Return</kbd> 684with the cursor anywhere on the line. If a line is extended with 685Backslash (<kbd class="kbd docutils literal notranslate">\</kbd>), the cursor must be on the last physical line. 686Submit a multi-line compound statement by entering a blank line after 687the statement.</p> 688<p>When one pastes code into Shell, it is not compiled and possibly executed 689until one hits <kbd class="kbd docutils literal notranslate">Return</kbd>, as specified above. 690One may edit pasted code first. 691If one pastes more than one statement into Shell, the result will be a 692<a class="reference internal" href="exceptions.html#SyntaxError" title="SyntaxError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">SyntaxError</span></code></a> when multiple statements are compiled as if they were one.</p> 693<p>Lines containing <code class="docutils literal notranslate"><span class="pre">RESTART</span></code> mean that the user execution process has been 694re-started. This occurs when the user execution process has crashed, 695when one requests a restart on the Shell menu, or when one runs code 696in an editor window.</p> 697<p>The editing features described in previous subsections work when entering 698code interactively. IDLE’s Shell window also responds to the following:</p> 699<ul class="simple"> 700<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">c</kbd></kbd> attempts to interrupt statement execution (but may fail).</p></li> 701<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">d</kbd></kbd> closes Shell if typed at a <code class="docutils literal notranslate"><span class="pre">>>></span></code> prompt.</p></li> 702<li><p><kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">Alt</kbd>-<kbd class="kbd docutils literal notranslate">p</kbd></kbd> and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">Alt</kbd>-<kbd class="kbd docutils literal notranslate">n</kbd></kbd> (<kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">p</kbd></kbd> and <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">C</kbd>-<kbd class="kbd docutils literal notranslate">n</kbd></kbd> on macOS) 703retrieve to the current prompt the previous or next previously 704entered statement that matches anything already typed.</p></li> 705<li><p><kbd class="kbd docutils literal notranslate">Return</kbd> while the cursor is on any previous statement 706appends the latter to anything already typed at the prompt.</p></li> 707</ul> 708</section> 709<section id="text-colors"> 710<h3>Text colors<a class="headerlink" href="#text-colors" title="Permalink to this heading">¶</a></h3> 711<p>Idle defaults to black on white text, but colors text with special meanings. 712For the shell, these are shell output, shell error, user output, and 713user error. For Python code, at the shell prompt or in an editor, these are 714keywords, builtin class and function names, names following <code class="docutils literal notranslate"><span class="pre">class</span></code> and 715<code class="docutils literal notranslate"><span class="pre">def</span></code>, strings, and comments. For any text window, these are the cursor (when 716present), found text (when possible), and selected text.</p> 717<p>IDLE also highlights the <a class="reference internal" href="../reference/lexical_analysis.html#soft-keywords"><span class="std std-ref">soft keywords</span></a> <a class="reference internal" href="../reference/compound_stmts.html#match"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">match</span></code></a>, 718<a class="reference internal" href="../reference/compound_stmts.html#match"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">case</span></code></a>, and <a class="reference internal" href="../reference/compound_stmts.html#wildcard-patterns"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">_</span></code></a> in 719pattern-matching statements. However, this highlighting is not perfect and 720will be incorrect in some rare cases, including some <code class="docutils literal notranslate"><span class="pre">_</span></code>-s in <code class="docutils literal notranslate"><span class="pre">case</span></code> 721patterns.</p> 722<p>Text coloring is done in the background, so uncolorized text is occasionally 723visible. To change the color scheme, use the Configure IDLE dialog 724Highlighting tab. The marking of debugger breakpoint lines in the editor and 725text in popups and dialogs is not user-configurable.</p> 726</section> 727</section> 728<section id="startup-and-code-execution"> 729<h2>Startup and Code Execution<a class="headerlink" href="#startup-and-code-execution" title="Permalink to this heading">¶</a></h2> 730<p>Upon startup with the <code class="docutils literal notranslate"><span class="pre">-s</span></code> option, IDLE will execute the file referenced by 731the environment variables <span class="target" id="index-5"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">IDLESTARTUP</span></code> or <span class="target" id="index-6"></span><a class="reference internal" href="../using/cmdline.html#envvar-PYTHONSTARTUP"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONSTARTUP</span></code></a>. 732IDLE first checks for <code class="docutils literal notranslate"><span class="pre">IDLESTARTUP</span></code>; if <code class="docutils literal notranslate"><span class="pre">IDLESTARTUP</span></code> is present the file 733referenced is run. If <code class="docutils literal notranslate"><span class="pre">IDLESTARTUP</span></code> is not present, IDLE checks for 734<code class="docutils literal notranslate"><span class="pre">PYTHONSTARTUP</span></code>. Files referenced by these environment variables are 735convenient places to store functions that are used frequently from the IDLE 736shell, or for executing import statements to import common modules.</p> 737<p>In addition, <code class="docutils literal notranslate"><span class="pre">Tk</span></code> also loads a startup file if it is present. Note that the 738Tk file is loaded unconditionally. This additional file is <code class="docutils literal notranslate"><span class="pre">.Idle.py</span></code> and is 739looked for in the user’s home directory. Statements in this file will be 740executed in the Tk namespace, so this file is not useful for importing 741functions to be used from IDLE’s Python shell.</p> 742<section id="command-line-usage"> 743<h3>Command line usage<a class="headerlink" href="#command-line-usage" title="Permalink to this heading">¶</a></h3> 744<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ... 745 746-c command run command in the shell window 747-d enable debugger and open shell window 748-e open editor window 749-h print help message with legal combinations and exit 750-i open shell window 751-r file run file in shell window 752-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window 753-t title set title of shell window 754- run stdin in shell (- must be last option before args) 755</pre></div> 756</div> 757<p>If there are arguments:</p> 758<ul class="simple"> 759<li><p>If <code class="docutils literal notranslate"><span class="pre">-</span></code>, <code class="docutils literal notranslate"><span class="pre">-c</span></code>, or <code class="docutils literal notranslate"><span class="pre">r</span></code> is used, all arguments are placed in 760<code class="docutils literal notranslate"><span class="pre">sys.argv[1:...]</span></code> and <code class="docutils literal notranslate"><span class="pre">sys.argv[0]</span></code> is set to <code class="docutils literal notranslate"><span class="pre">''</span></code>, <code class="docutils literal notranslate"><span class="pre">'-c'</span></code>, 761or <code class="docutils literal notranslate"><span class="pre">'-r'</span></code>. No editor window is opened, even if that is the default 762set in the Options dialog.</p></li> 763<li><p>Otherwise, arguments are files opened for editing and 764<code class="docutils literal notranslate"><span class="pre">sys.argv</span></code> reflects the arguments passed to IDLE itself.</p></li> 765</ul> 766</section> 767<section id="startup-failure"> 768<h3>Startup failure<a class="headerlink" href="#startup-failure" title="Permalink to this heading">¶</a></h3> 769<p>IDLE uses a socket to communicate between the IDLE GUI process and the user 770code execution process. A connection must be established whenever the Shell 771starts or restarts. (The latter is indicated by a divider line that says 772‘RESTART’). If the user process fails to connect to the GUI process, it 773usually displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message 774that directs the user here. It then exits.</p> 775<p>One specific connection failure on Unix systems results from 776misconfigured masquerading rules somewhere in a system’s network setup. 777When IDLE is started from a terminal, one will see a message starting 778with <code class="docutils literal notranslate"><span class="pre">**</span> <span class="pre">Invalid</span> <span class="pre">host:</span></code>. 779The valid value is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span> <span class="pre">(idlelib.rpc.LOCALHOST)</span></code>. 780One can diagnose with <code class="docutils literal notranslate"><span class="pre">tcpconnect</span> <span class="pre">-irv</span> <span class="pre">127.0.0.1</span> <span class="pre">6543</span></code> in one 781terminal window and <code class="docutils literal notranslate"><span class="pre">tcplisten</span> <span class="pre"><same</span> <span class="pre">args></span></code> in another.</p> 782<p>A common cause of failure is a user-written file with the same name as a 783standard library module, such as <em>random.py</em> and <em>tkinter.py</em>. When such a 784file is located in the same directory as a file that is about to be run, 785IDLE cannot import the stdlib file. The current fix is to rename the 786user file.</p> 787<p>Though less common than in the past, an antivirus or firewall program may 788stop the connection. If the program cannot be taught to allow the 789connection, then it must be turned off for IDLE to work. It is safe to 790allow this internal connection because no data is visible on external 791ports. A similar problem is a network mis-configuration that blocks 792connections.</p> 793<p>Python installation issues occasionally stop IDLE: multiple versions can 794clash, or a single installation might need admin access. If one undo the 795clash, or cannot or does not want to run as admin, it might be easiest to 796completely remove Python and start over.</p> 797<p>A zombie pythonw.exe process could be a problem. On Windows, use Task 798Manager to check for one and stop it if there is. Sometimes a restart 799initiated by a program crash or Keyboard Interrupt (control-C) may fail 800to connect. Dismissing the error box or using Restart Shell on the Shell 801menu may fix a temporary problem.</p> 802<p>When IDLE first starts, it attempts to read user configuration files in 803<code class="docutils literal notranslate"><span class="pre">~/.idlerc/</span></code> (~ is one’s home directory). If there is a problem, an error 804message should be displayed. Leaving aside random disk glitches, this can 805be prevented by never editing the files by hand. Instead, use the 806configuration dialog, under Options. Once there is an error in a user 807configuration file, the best solution may be to delete it and start over 808with the settings dialog.</p> 809<p>If IDLE quits with no message, and it was not started from a console, try 810starting it from a console or terminal (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if 811this results in an error message.</p> 812<p>On Unix-based systems with tcl/tk older than <code class="docutils literal notranslate"><span class="pre">8.6.11</span></code> (see 813<code class="docutils literal notranslate"><span class="pre">About</span> <span class="pre">IDLE</span></code>) certain characters of certain fonts can cause 814a tk failure with a message to the terminal. This can happen either 815if one starts IDLE to edit a file with such a character or later 816when entering such a character. If one cannot upgrade tcl/tk, 817then re-configure IDLE to use a font that works better.</p> 818</section> 819<section id="running-user-code"> 820<h3>Running user code<a class="headerlink" href="#running-user-code" title="Permalink to this heading">¶</a></h3> 821<p>With rare exceptions, the result of executing Python code with IDLE is 822intended to be the same as executing the same code by the default method, 823directly with Python in a text-mode system console or terminal window. 824However, the different interface and operation occasionally affect 825visible results. For instance, <code class="docutils literal notranslate"><span class="pre">sys.modules</span></code> starts with more entries, 826and <code class="docutils literal notranslate"><span class="pre">threading.active_count()</span></code> returns 2 instead of 1.</p> 827<p>By default, IDLE runs user code in a separate OS process rather than in 828the user interface process that runs the shell and editor. In the execution 829process, it replaces <code class="docutils literal notranslate"><span class="pre">sys.stdin</span></code>, <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code>, and <code class="docutils literal notranslate"><span class="pre">sys.stderr</span></code> 830with objects that get input from and send output to the Shell window. 831The original values stored in <code class="docutils literal notranslate"><span class="pre">sys.__stdin__</span></code>, <code class="docutils literal notranslate"><span class="pre">sys.__stdout__</span></code>, and 832<code class="docutils literal notranslate"><span class="pre">sys.__stderr__</span></code> are not touched, but may be <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p> 833<p>Sending print output from one process to a text widget in another is 834slower than printing to a system terminal in the same process. 835This has the most effect when printing multiple arguments, as the string 836for each argument, each separator, the newline are sent separately. 837For development, this is usually not a problem, but if one wants to 838print faster in IDLE, format and join together everything one wants 839displayed together and then print a single string. Both format strings 840and <a class="reference internal" href="stdtypes.html#str.join" title="str.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">str.join()</span></code></a> can help combine fields and lines.</p> 841<p>IDLE’s standard stream replacements are not inherited by subprocesses 842created in the execution process, whether directly by user code or by 843modules such as multiprocessing. If such subprocess use <code class="docutils literal notranslate"><span class="pre">input</span></code> from 844sys.stdin or <code class="docutils literal notranslate"><span class="pre">print</span></code> or <code class="docutils literal notranslate"><span class="pre">write</span></code> to sys.stdout or sys.stderr, 845IDLE should be started in a command line window. (On Windows, 846use <code class="docutils literal notranslate"><span class="pre">python</span></code> or <code class="docutils literal notranslate"><span class="pre">py</span></code> rather than <code class="docutils literal notranslate"><span class="pre">pythonw</span></code> or <code class="docutils literal notranslate"><span class="pre">pyw</span></code>.) 847The secondary subprocess 848will then be attached to that window for input and output.</p> 849<p>If <code class="docutils literal notranslate"><span class="pre">sys</span></code> is reset by user code, such as with <code class="docutils literal notranslate"><span class="pre">importlib.reload(sys)</span></code>, 850IDLE’s changes are lost and input from the keyboard and output to the screen 851will not work correctly.</p> 852<p>When Shell has the focus, it controls the keyboard and screen. This is 853normally transparent, but functions that directly access the keyboard 854and screen will not work. These include system-specific functions that 855determine whether a key has been pressed and if so, which.</p> 856<p>The IDLE code running in the execution process adds frames to the call stack 857that would not be there otherwise. IDLE wraps <code class="docutils literal notranslate"><span class="pre">sys.getrecursionlimit</span></code> and 858<code class="docutils literal notranslate"><span class="pre">sys.setrecursionlimit</span></code> to reduce the effect of the additional stack 859frames.</p> 860<p>When user code raises SystemExit either directly or by calling sys.exit, 861IDLE returns to a Shell prompt instead of exiting.</p> 862</section> 863<section id="user-output-in-shell"> 864<h3>User output in Shell<a class="headerlink" href="#user-output-in-shell" title="Permalink to this heading">¶</a></h3> 865<p>When a program outputs text, the result is determined by the 866corresponding output device. When IDLE executes user code, <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code> 867and <code class="docutils literal notranslate"><span class="pre">sys.stderr</span></code> are connected to the display area of IDLE’s Shell. Some of 868its features are inherited from the underlying Tk Text widget. Others 869are programmed additions. Where it matters, Shell is designed for development 870rather than production runs.</p> 871<p>For instance, Shell never throws away output. A program that sends unlimited 872output to Shell will eventually fill memory, resulting in a memory error. 873In contrast, some system text windows only keep the last n lines of output. 874A Windows console, for instance, keeps a user-settable 1 to 9999 lines, 875with 300 the default.</p> 876<p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints) in 877the BMP (Basic Multilingual Plane) subset of Unicode. Which characters are 878displayed with a proper glyph and which with a replacement box depends on the 879operating system and installed fonts. Tab characters cause the following text 880to begin after the next tab stop. (They occur every 8 ‘characters’). Newline 881characters cause following text to appear on a new line. Other control 882characters are ignored or displayed as a space, box, or something else, 883depending on the operating system and font. (Moving the text cursor through 884such output with arrow keys may exhibit some surprising spacing behavior.)</p> 885<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="s1">'a</span><span class="se">\t</span><span class="s1">b</span><span class="se">\a</span><span class="s1"><</span><span class="se">\x02</span><span class="s1">><</span><span class="se">\r</span><span class="s1">></span><span class="se">\b</span><span class="s1">c</span><span class="se">\n</span><span class="s1">d'</span> <span class="c1"># Enter 22 chars.</span> 886<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> 887<span class="go">14</span> 888<span class="gp">>>> </span><span class="n">s</span> <span class="c1"># Display repr(s)</span> 889<span class="go">'a\tb\x07<\x02><\r>\x08c\nd'</span> 890<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">''</span><span class="p">)</span> <span class="c1"># Display s as is.</span> 891<span class="go"># Result varies by OS and font. Try it.</span> 892</pre></div> 893</div> 894<p>The <code class="docutils literal notranslate"><span class="pre">repr</span></code> function is used for interactive echo of expression 895values. It returns an altered version of the input string in which 896control codes, some BMP codepoints, and all non-BMP codepoints are 897replaced with escape codes. As demonstrated above, it allows one to 898identify the characters in a string, regardless of how they are displayed.</p> 899<p>Normal and error output are generally kept separate (on separate lines) 900from code input and each other. They each get different highlight colors.</p> 901<p>For SyntaxError tracebacks, the normal ‘^’ marking where the error was 902detected is replaced by coloring the text with an error highlight. 903When code run from a file causes other exceptions, one may right click 904on a traceback line to jump to the corresponding line in an IDLE editor. 905The file will be opened if necessary.</p> 906<p>Shell has a special facility for squeezing output lines down to a 907‘Squeezed text’ label. This is done automatically 908for output over N lines (N = 50 by default). 909N can be changed in the PyShell section of the General 910page of the Settings dialog. Output with fewer lines can be squeezed by 911right clicking on the output. This can be useful lines long enough to slow 912down scrolling.</p> 913<p>Squeezed output is expanded in place by double-clicking the label. 914It can also be sent to the clipboard or a separate view window by 915right-clicking the label.</p> 916</section> 917<section id="developing-tkinter-applications"> 918<h3>Developing tkinter applications<a class="headerlink" href="#developing-tkinter-applications" title="Permalink to this heading">¶</a></h3> 919<p>IDLE is intentionally different from standard Python in order to 920facilitate development of tkinter programs. Enter <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">tkinter</span> <span class="pre">as</span> <span class="pre">tk;</span> 921<span class="pre">root</span> <span class="pre">=</span> <span class="pre">tk.Tk()</span></code> in standard Python and nothing appears. Enter the same 922in IDLE and a tk window appears. In standard Python, one must also enter 923<code class="docutils literal notranslate"><span class="pre">root.update()</span></code> to see the window. IDLE does the equivalent in the 924background, about 20 times a second, which is about every 50 milliseconds. 925Next enter <code class="docutils literal notranslate"><span class="pre">b</span> <span class="pre">=</span> <span class="pre">tk.Button(root,</span> <span class="pre">text='button');</span> <span class="pre">b.pack()</span></code>. Again, 926nothing visibly changes in standard Python until one enters <code class="docutils literal notranslate"><span class="pre">root.update()</span></code>.</p> 927<p>Most tkinter programs run <code class="docutils literal notranslate"><span class="pre">root.mainloop()</span></code>, which usually does not 928return until the tk app is destroyed. If the program is run with 929<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-i</span></code> or from an IDLE editor, a <code class="docutils literal notranslate"><span class="pre">>>></span></code> shell prompt does not 930appear until <code class="docutils literal notranslate"><span class="pre">mainloop()</span></code> returns, at which time there is nothing left 931to interact with.</p> 932<p>When running a tkinter program from an IDLE editor, one can comment out 933the mainloop call. One then gets a shell prompt immediately and can 934interact with the live application. One just has to remember to 935re-enable the mainloop call when running in standard Python.</p> 936</section> 937<section id="running-without-a-subprocess"> 938<h3>Running without a subprocess<a class="headerlink" href="#running-without-a-subprocess" title="Permalink to this heading">¶</a></h3> 939<p>By default, IDLE executes user code in a separate subprocess via a socket, 940which uses the internal loopback interface. This connection is not 941externally visible and no data is sent to or received from the internet. 942If firewall software complains anyway, you can ignore it.</p> 943<p>If the attempt to make the socket connection fails, Idle will notify you. 944Such failures are sometimes transient, but if persistent, the problem 945may be either a firewall blocking the connection or misconfiguration of 946a particular system. Until the problem is fixed, one can run Idle with 947the -n command line switch.</p> 948<p>If IDLE is started with the -n command line switch it will run in a 949single process and will not create the subprocess which runs the RPC 950Python execution server. This can be useful if Python cannot create 951the subprocess or the RPC socket interface on your platform. However, 952in this mode user code is not isolated from IDLE itself. Also, the 953environment is not restarted when Run/Run Module (F5) is selected. If 954your code has been modified, you must reload() the affected modules and 955re-import any specific items (e.g. from foo import baz) if the changes 956are to take effect. For these reasons, it is preferable to run IDLE 957with the default subprocess if at all possible.</p> 958<div class="deprecated"> 959<p><span class="versionmodified deprecated">Deprecated since version 3.4.</span></p> 960</div> 961</section> 962</section> 963<section id="help-and-preferences"> 964<h2>Help and Preferences<a class="headerlink" href="#help-and-preferences" title="Permalink to this heading">¶</a></h2> 965<section id="help-sources"> 966<span id="id6"></span><h3>Help sources<a class="headerlink" href="#help-sources" title="Permalink to this heading">¶</a></h3> 967<p>Help menu entry “IDLE Help” displays a formatted html version of the 968IDLE chapter of the Library Reference. The result, in a read-only 969tkinter text window, is close to what one sees in a web browser. 970Navigate through the text with a mousewheel, 971the scrollbar, or up and down arrow keys held down. 972Or click the TOC (Table of Contents) button and select a section 973header in the opened box.</p> 974<p>Help menu entry “Python Docs” opens the extensive sources of help, 975including tutorials, available at <code class="docutils literal notranslate"><span class="pre">docs.python.org/x.y</span></code>, where ‘x.y’ 976is the currently running Python version. If your system 977has an off-line copy of the docs (this may be an installation option), 978that will be opened instead.</p> 979<p>Selected URLs can be added or removed from the help menu at any time using the 980General tab of the Configure IDLE dialog.</p> 981</section> 982<section id="setting-preferences"> 983<span id="preferences"></span><h3>Setting preferences<a class="headerlink" href="#setting-preferences" title="Permalink to this heading">¶</a></h3> 984<p>The font preferences, highlighting, keys, and general preferences can be 985changed via Configure IDLE on the Option menu. 986Non-default user settings are saved in a <code class="docutils literal notranslate"><span class="pre">.idlerc</span></code> directory in the user’s 987home directory. Problems caused by bad user configuration files are solved 988by editing or deleting one or more of the files in <code class="docutils literal notranslate"><span class="pre">.idlerc</span></code>.</p> 989<p>On the Font tab, see the text sample for the effect of font face and size 990on multiple characters in multiple languages. Edit the sample to add 991other characters of personal interest. Use the sample to select 992monospaced fonts. If particular characters have problems in Shell or an 993editor, add them to the top of the sample and try changing first size 994and then font.</p> 995<p>On the Highlights and Keys tab, select a built-in or custom color theme 996and key set. To use a newer built-in color theme or key set with older 997IDLEs, save it as a new custom theme or key set and it well be accessible 998to older IDLEs.</p> 999</section> 1000<section id="idle-on-macos"> 1001<h3>IDLE on macOS<a class="headerlink" href="#idle-on-macos" title="Permalink to this heading">¶</a></h3> 1002<p>Under System Preferences: Dock, one can set “Prefer tabs when opening 1003documents” to “Always”. This setting is not compatible with the tk/tkinter 1004GUI framework used by IDLE, and it breaks a few IDLE features.</p> 1005</section> 1006<section id="extensions"> 1007<h3>Extensions<a class="headerlink" href="#extensions" title="Permalink to this heading">¶</a></h3> 1008<p>IDLE contains an extension facility. Preferences for extensions can be 1009changed with the Extensions tab of the preferences dialog. See the 1010beginning of config-extensions.def in the idlelib directory for further 1011information. The only current default extension is zzdummy, an example 1012also used for testing.</p> 1013</section> 1014</section> 1015<section id="module-idlelib"> 1016<span id="idlelib"></span><h2>idlelib<a class="headerlink" href="#module-idlelib" title="Permalink to this heading">¶</a></h2> 1017<p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/main/Lib/idlelib">Lib/idlelib</a></p> 1018<hr class="docutils" /> 1019<p>The Lib/idlelib package implements the IDLE application. See the rest 1020of this page for how to use IDLE.</p> 1021<p>The files in idlelib are described in idlelib/README.txt. Access it 1022either in idlelib or click Help => About IDLE on the IDLE menu. This 1023file also maps IDLE menu items to the code that implements the item. 1024Except for files listed under ‘Startup’, the idlelib code is ‘private’ in 1025sense that feature changes can be backported (see <span class="target" id="index-7"></span><a class="pep reference external" href="https://peps.python.org/pep-0434/"><strong>PEP 434</strong></a>).</p> 1026</section> 1027</section> 1028 1029 1030 <div class="clearer"></div> 1031 </div> 1032 </div> 1033 </div> 1034 <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> 1035 <div class="sphinxsidebarwrapper"> 1036 <div> 1037 <h3><a href="../contents.html">Table of Contents</a></h3> 1038 <ul> 1039<li><a class="reference internal" href="#">IDLE</a><ul> 1040<li><a class="reference internal" href="#menus">Menus</a><ul> 1041<li><a class="reference internal" href="#file-menu-shell-and-editor">File menu (Shell and Editor)</a></li> 1042<li><a class="reference internal" href="#edit-menu-shell-and-editor">Edit menu (Shell and Editor)</a></li> 1043<li><a class="reference internal" href="#format-menu-editor-window-only">Format menu (Editor window only)</a></li> 1044<li><a class="reference internal" href="#run-menu-editor-window-only">Run menu (Editor window only)</a></li> 1045<li><a class="reference internal" href="#shell-menu-shell-window-only">Shell menu (Shell window only)</a></li> 1046<li><a class="reference internal" href="#debug-menu-shell-window-only">Debug menu (Shell window only)</a></li> 1047<li><a class="reference internal" href="#options-menu-shell-and-editor">Options menu (Shell and Editor)</a></li> 1048<li><a class="reference internal" href="#window-menu-shell-and-editor">Window menu (Shell and Editor)</a></li> 1049<li><a class="reference internal" href="#help-menu-shell-and-editor">Help menu (Shell and Editor)</a></li> 1050<li><a class="reference internal" href="#context-menus">Context menus</a></li> 1051</ul> 1052</li> 1053<li><a class="reference internal" href="#editing-and-navigation">Editing and Navigation</a><ul> 1054<li><a class="reference internal" href="#editor-windows">Editor windows</a></li> 1055<li><a class="reference internal" href="#key-bindings">Key bindings</a></li> 1056<li><a class="reference internal" href="#automatic-indentation">Automatic indentation</a></li> 1057<li><a class="reference internal" href="#search-and-replace">Search and Replace</a></li> 1058<li><a class="reference internal" href="#completions">Completions</a></li> 1059<li><a class="reference internal" href="#calltips">Calltips</a></li> 1060<li><a class="reference internal" href="#code-context">Code Context</a></li> 1061<li><a class="reference internal" href="#shell-window">Shell window</a></li> 1062<li><a class="reference internal" href="#text-colors">Text colors</a></li> 1063</ul> 1064</li> 1065<li><a class="reference internal" href="#startup-and-code-execution">Startup and Code Execution</a><ul> 1066<li><a class="reference internal" href="#command-line-usage">Command line usage</a></li> 1067<li><a class="reference internal" href="#startup-failure">Startup failure</a></li> 1068<li><a class="reference internal" href="#running-user-code">Running user code</a></li> 1069<li><a class="reference internal" href="#user-output-in-shell">User output in Shell</a></li> 1070<li><a class="reference internal" href="#developing-tkinter-applications">Developing tkinter applications</a></li> 1071<li><a class="reference internal" href="#running-without-a-subprocess">Running without a subprocess</a></li> 1072</ul> 1073</li> 1074<li><a class="reference internal" href="#help-and-preferences">Help and Preferences</a><ul> 1075<li><a class="reference internal" href="#help-sources">Help sources</a></li> 1076<li><a class="reference internal" href="#setting-preferences">Setting preferences</a></li> 1077<li><a class="reference internal" href="#idle-on-macos">IDLE on macOS</a></li> 1078<li><a class="reference internal" href="#extensions">Extensions</a></li> 1079</ul> 1080</li> 1081<li><a class="reference internal" href="#module-idlelib">idlelib</a></li> 1082</ul> 1083</li> 1084</ul> 1085 1086 </div> 1087 <div> 1088 <h4>Previous topic</h4> 1089 <p class="topless"><a href="tkinter.ttk.html" 1090 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tkinter.ttk</span></code> — Tk themed widgets</a></p> 1091 </div> 1092 <div> 1093 <h4>Next topic</h4> 1094 <p class="topless"><a href="development.html" 1095 title="next chapter">Development Tools</a></p> 1096 </div> 1097 <div role="note" aria-label="source link"> 1098 <h3>This Page</h3> 1099 <ul class="this-page-menu"> 1100 <li><a href="../bugs.html">Report a Bug</a></li> 1101 <li> 1102 <a href="https://github.com/python/cpython/blob/main/Doc/library/idle.rst" 1103 rel="nofollow">Show Source 1104 </a> 1105 </li> 1106 </ul> 1107 </div> 1108 </div> 1109<div id="sidebarbutton" title="Collapse sidebar"> 1110<span>«</span> 1111</div> 1112 1113 </div> 1114 <div class="clearer"></div> 1115 </div> 1116 <div class="related" role="navigation" aria-label="related navigation"> 1117 <h3>Navigation</h3> 1118 <ul> 1119 <li class="right" style="margin-right: 10px"> 1120 <a href="../genindex.html" title="General Index" 1121 >index</a></li> 1122 <li class="right" > 1123 <a href="../py-modindex.html" title="Python Module Index" 1124 >modules</a> |</li> 1125 <li class="right" > 1126 <a href="development.html" title="Development Tools" 1127 >next</a> |</li> 1128 <li class="right" > 1129 <a href="tkinter.ttk.html" title="tkinter.ttk — Tk themed widgets" 1130 >previous</a> |</li> 1131 1132 <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> 1133 <li><a href="https://www.python.org/">Python</a> »</li> 1134 <li class="switchers"> 1135 <div class="language_switcher_placeholder"></div> 1136 <div class="version_switcher_placeholder"></div> 1137 </li> 1138 <li> 1139 1140 </li> 1141 <li id="cpython-language-and-version"> 1142 <a href="../index.html">3.14.0a0 Documentation</a> » 1143 </li> 1144 1145 <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> 1146 <li class="nav-item nav-item-2"><a href="tk.html" >Graphical User Interfaces with Tk</a> »</li> 1147 <li class="nav-item nav-item-this"><a href="">IDLE</a></li> 1148 <li class="right"> 1149 1150 1151 <div class="inline-search" role="search"> 1152 <form class="inline-search" action="../search.html" method="get"> 1153 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" /> 1154 <input type="submit" value="Go" /> 1155 </form> 1156 </div> 1157 | 1158 </li> 1159 <li class="right"> 1160<label class="theme-selector-label"> 1161 Theme 1162 <select class="theme-selector" oninput="activateTheme(this.value)"> 1163 <option value="auto" selected>Auto</option> 1164 <option value="light">Light</option> 1165 <option value="dark">Dark</option> 1166 </select> 1167</label> |</li> 1168 1169 </ul> 1170 </div> 1171 <div class="footer"> 1172 © <a href="../copyright.html">Copyright</a> 2001-2024, Python Software Foundation. 1173 <br /> 1174 This page is licensed under the Python Software Foundation License Version 2. 1175 <br /> 1176 Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. 1177 <br /> 1178 See <a href="/license.html">History and License</a> for more information.<br /> 1179 <br /> 1180 1181 The Python Software Foundation is a non-profit corporation. 1182<a href="https://www.python.org/psf/donations/">Please donate.</a> 1183<br /> 1184 <br /> 1185 1186 Last updated on Oct 14, 2024 (20:27 UTC). 1187 <a href="/bugs.html">Found a bug</a>? 1188 <br /> 1189 1190 Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.0.1. 1191 </div> 1192 1193 </body> 1194</html> 1195