<p>IDLE is Python’s Integrated Development and Learning Environment.</p>
<p>IDLE has the following features:</p>
<ulclass="simple">
<li><p>coded in 100% pure Python, using the <aclass="reference internal"href="tkinter.html#module-tkinter"title="tkinter: Interface to Tcl/Tk for graphical user interfaces"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">tkinter</span></code></a> GUI toolkit</p></li>
<li><p>cross-platform: works mostly the same on Windows, Unix, and macOS</p></li>
<li><p>Python shell window (interactive interpreter) with colorizing
of code input, output, and error messages</p></li>
<li><p>multi-window text editor with multiple undo, Python colorizing,
smart indent, call tips, auto completion, and other features</p></li>
<li><p>search within any window, replace within editor windows, and search
through multiple files (grep)</p></li>
<li><p>debugger with persistent breakpoints, stepping, and viewing
of global and local namespaces</p></li>
<li><p>configuration, browsers, and other dialogs</p></li>
<dt>Close Window</dt><dd><p>Close the current window (if an unsaved editor, ask to save; if an unsaved
Shell, ask to quit execution). Calling <codeclass="docutils literal notranslate"><spanclass="pre">exit()</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">close()</span></code> in the Shell
window also closes Shell. If this is the only window, also exit IDLE.</p>
<spanid="format-menu"></span><h3>Format menu (Editor window only)<aclass="headerlink"href="#format-menu-editor-window-only"title="Permalink to this heading">¶</a></h3>
<spanid="index-2"></span><h3>Run menu (Editor window only)<aclass="headerlink"href="#run-menu-editor-window-only"title="Permalink to this heading">¶</a></h3>
<dt>Run Module</dt><dd><p>Do <aclass="reference internal"href="#check-module"><spanclass="std std-ref">Check Module</span></a>. If no error, restart the shell to clean the
environment, then execute the module. Output is displayed in the Shell
window. Note that output requires use of <codeclass="docutils literal notranslate"><spanclass="pre">print</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">write</span></code>.
When execution is complete, the Shell retains focus and displays a prompt.
At this point, one may interactively explore the result of execution.
This is similar to executing a file with <codeclass="docutils literal notranslate"><spanclass="pre">python</span><spanclass="pre">-i</span><spanclass="pre">file</span></code> at a command
line.</p>
</dd>
</dl>
<dlclass="simple"id="run-custom">
<dt>Run… Customized</dt><dd><p>Same as <aclass="reference internal"href="#run-module"><spanclass="std std-ref">Run Module</span></a>, but run the module with customized
settings. <em>Command Line Arguments</em> extend <aclass="reference internal"href="sys.html#sys.argv"title="sys.argv"><codeclass="xref py py-data docutils literal notranslate"><spanclass="pre">sys.argv</span></code></a> as if passed
on a command line. The module can be run in the Shell without restarting.</p>
</dd>
</dl>
<dlclass="simple"id="check-module">
<dt>Check Module</dt><dd><p>Check the syntax of the module currently open in the Editor window. If the
module has not been saved IDLE will either prompt the user to save or
autosave, as selected in the General tab of the Idle Settings dialog. If
there is a syntax error, the approximate location is indicated in the
Editor window.</p>
</dd>
</dl>
<dlclass="simple"id="python-shell">
<dt>Python Shell</dt><dd><p>Open or wake up the Python Shell window.</p>
<p>In this section, ‘C’ refers to the <kbdclass="kbd docutils literal notranslate">Control</kbd> key on Windows and Unix and
the <kbdclass="kbd docutils literal notranslate">Command</kbd> key on macOS.</p>
<ul>
<li><p><kbdclass="kbd docutils literal notranslate">Backspace</kbd> deletes to the left; <kbdclass="kbd docutils literal notranslate">Del</kbd> deletes to the right</p></li>
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">e</kbd></kbd> end of line</p></li>
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">k</kbd></kbd> kill line (but doesn’t put it in clipboard)</p></li>
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">l</kbd></kbd> center window around the insertion point</p></li>
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">b</kbd></kbd> go backward one character without deleting (usually you can
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">f</kbd></kbd> go forward one character without deleting (usually you can
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">p</kbd></kbd> go up one line (usually you can also use the cursor key for
<h3>Search and Replace<aclass="headerlink"href="#search-and-replace"title="Permalink to this heading">¶</a></h3>
<p>Any selection becomes a search target. However, only selections within
a line work because searches are only performed within lines with the
terminal newline removed. If <codeclass="docutils literal notranslate"><spanclass="pre">[x]</span><spanclass="pre">Regular</span><spanclass="pre">expresion</span></code> is checked, the
target is interpreted according to the Python re module.</p>
</section>
<sectionid="completions">
<spanid="id3"></span><h3>Completions<aclass="headerlink"href="#completions"title="Permalink to this heading">¶</a></h3>
and by a single click within the box. Close the box with <kbdclass="kbd docutils literal notranslate">Escape</kbd>,
<kbdclass="kbd docutils literal notranslate">Enter</kbd>, and double <kbdclass="kbd docutils literal notranslate">Tab</kbd> keys or clicks outside the box.
A double click within the box selects and closes.</p>
<p>One way to open a box is to type a key character and wait for a
predefined interval. This defaults to 2 seconds; customize it
in the settings dialog. (To prevent auto popups, set the delay to a
large number of milliseconds, such as 100000000.) For imported module
names or class or function attributes, type ‘.’.
For filenames in the root directory, type <aclass="reference internal"href="os.html#os.sep"title="os.sep"><codeclass="xref py py-data docutils literal notranslate"><spanclass="pre">os.sep</span></code></a> or
<aclass="reference internal"href="os.html#os.altsep"title="os.altsep"><codeclass="xref py py-data docutils literal notranslate"><spanclass="pre">os.altsep</span></code></a> immediately after an opening quote. (On Windows,
one can specify a drive first.) Move into subdirectories by typing a
directory name and a separator.</p>
<p>Instead of waiting, or after a box is closed, open a completion box
immediately with Show Completions on the Edit menu. The default hot
key is <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">space</kbd></kbd>. If one types a prefix for the desired name
<p>Within an editor window containing Python code, code context can be toggled
in order to show or hide a pane at the top of the window. When shown, this
pane freezes the opening lines for block code, such as those beginning with
<codeclass="docutils literal notranslate"><spanclass="pre">class</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">def</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">if</span></code> keywords, that would have otherwise scrolled
out of view. The size of the pane will be expanded and contracted as needed
to show the all current levels of context, up to the maximum number of
lines defined in the Configure IDLE dialog (which defaults to 15). If there
are no current context lines and the feature is toggled on, a single blank
line will display. Clicking on a line in the context pane will move that
line to the top of the editor.</p>
<p>The text and background colors for the context pane can be configured under
the Highlights tab in the Configure IDLE dialog.</p>
<aclass="reference internal"href="exceptions.html#SyntaxError"title="SyntaxError"><codeclass="xref py py-exc docutils literal notranslate"><spanclass="pre">SyntaxError</span></code></a> when multiple statements are compiled as if they were one.</p>
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">Alt</kbd>-<kbdclass="kbd docutils literal notranslate">p</kbd></kbd> retrieves previous command matching what you have typed. On
<p>IDLE also highlights the <aclass="reference internal"href="../reference/lexical_analysis.html#soft-keywords"><spanclass="std std-ref">soft keywords</span></a><aclass="reference internal"href="../reference/compound_stmts.html#match"><codeclass="xref std std-keyword docutils literal notranslate"><spanclass="pre">match</span></code></a>,
<aclass="reference internal"href="../reference/compound_stmts.html#match"><codeclass="xref std std-keyword docutils literal notranslate"><spanclass="pre">case</span></code></a>, and <aclass="reference internal"href="../reference/compound_stmts.html#wildcard-patterns"><codeclass="xref std std-keyword docutils literal notranslate"><spanclass="pre">_</span></code></a> in
pattern-matching statements. However, this highlighting is not perfect and
will be incorrect in some rare cases, including some <codeclass="docutils literal notranslate"><spanclass="pre">_</span></code>-s in <codeclass="docutils literal notranslate"><spanclass="pre">case</span></code>
<p>Upon startup with the <codeclass="docutils literal notranslate"><spanclass="pre">-s</span></code> option, IDLE will execute the file referenced by
the environment variables <spanclass="target"id="index-5"></span><codeclass="xref std std-envvar docutils literal notranslate"><spanclass="pre">IDLESTARTUP</span></code> or <spanclass="target"id="index-6"></span><aclass="reference internal"href="../using/cmdline.html#envvar-PYTHONSTARTUP"><codeclass="xref std std-envvar docutils literal notranslate"><spanclass="pre">PYTHONSTARTUP</span></code></a>.
IDLE first checks for <codeclass="docutils literal notranslate"><spanclass="pre">IDLESTARTUP</span></code>; if <codeclass="docutils literal notranslate"><spanclass="pre">IDLESTARTUP</span></code> is present the file
referenced is run. If <codeclass="docutils literal notranslate"><spanclass="pre">IDLESTARTUP</span></code> is not present, IDLE checks for
<codeclass="docutils literal notranslate"><spanclass="pre">PYTHONSTARTUP</span></code>. Files referenced by these environment variables are
convenient places to store functions that are used frequently from the IDLE
shell, or for executing import statements to import common modules.</p>
<p>In addition, <codeclass="docutils literal notranslate"><spanclass="pre">Tk</span></code> also loads a startup file if it is present. Note that the
Tk file is loaded unconditionally. This additional file is <codeclass="docutils literal notranslate"><spanclass="pre">.Idle.py</span></code> and is
looked for in the user’s home directory. Statements in this file will be
executed in the Tk namespace, so this file is not useful for importing
functions to be used from IDLE’s Python shell.</p>
-h print help message with legal combinations and exit
-i open shell window
-r file run file in shell window
-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window
-t title set title of shell window
- run stdin in shell (- must be last option before args)
</pre></div>
</div>
<p>If there are arguments:</p>
<ulclass="simple">
<li><p>If <codeclass="docutils literal notranslate"><spanclass="pre">-</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">-c</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">r</span></code> is used, all arguments are placed in
<codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[1:...]</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[0]</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">''</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">'-c'</span></code>,
or <codeclass="docutils literal notranslate"><spanclass="pre">'-r'</span></code>. No editor window is opened, even if that is the default
set in the Options dialog.</p></li>
<li><p>Otherwise, arguments are files opened for editing and
<codeclass="docutils literal notranslate"><spanclass="pre">sys.argv</span></code> reflects the arguments passed to IDLE itself.</p></li>
<p>IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
‘RESTART’). If the user process fails to connect to the GUI process, it
usually displays a <codeclass="docutils literal notranslate"><spanclass="pre">Tk</span></code> error box with a ‘cannot connect’ message
that directs the user here. It then exits.</p>
<p>One specific connection failure on Unix systems results from
misconfigured masquerading rules somewhere in a system’s network setup.
When IDLE is started from a terminal, one will see a message starting
with <codeclass="docutils literal notranslate"><spanclass="pre">**</span><spanclass="pre">Invalid</span><spanclass="pre">host:</span></code>.
The valid value is <codeclass="docutils literal notranslate"><spanclass="pre">127.0.0.1</span><spanclass="pre">(idlelib.rpc.LOCALHOST)</span></code>.
One can diagnose with <codeclass="docutils literal notranslate"><spanclass="pre">tcpconnect</span><spanclass="pre">-irv</span><spanclass="pre">127.0.0.1</span><spanclass="pre">6543</span></code> in one
terminal window and <codeclass="docutils literal notranslate"><spanclass="pre">tcplisten</span><spanclass="pre"><same</span><spanclass="pre">args></span></code> in another.</p>
<p>A common cause of failure is a user-written file with the same name as a
standard library module, such as <em>random.py</em> and <em>tkinter.py</em>. When such a
file is located in the same directory as a file that is about to be run,
IDLE cannot import the stdlib file. The current fix is to rename the
user file.</p>
<p>Though less common than in the past, an antivirus or firewall program may
stop the connection. If the program cannot be taught to allow the
connection, then it must be turned off for IDLE to work. It is safe to
allow this internal connection because no data is visible on external
ports. A similar problem is a network mis-configuration that blocks
connections.</p>
<p>Python installation issues occasionally stop IDLE: multiple versions can
clash, or a single installation might need admin access. If one undo the
clash, or cannot or does not want to run as admin, it might be easiest to
completely remove Python and start over.</p>
<p>A zombie pythonw.exe process could be a problem. On Windows, use Task
Manager to check for one and stop it if there is. Sometimes a restart
initiated by a program crash or Keyboard Interrupt (control-C) may fail
to connect. Dismissing the error box or using Restart Shell on the Shell
menu may fix a temporary problem.</p>
<p>When IDLE first starts, it attempts to read user configuration files in
<codeclass="docutils literal notranslate"><spanclass="pre">~/.idlerc/</span></code> (~ is one’s home directory). If there is a problem, an error
message should be displayed. Leaving aside random disk glitches, this can
be prevented by never editing the files by hand. Instead, use the
configuration dialog, under Options. Once there is an error in a user
configuration file, the best solution may be to delete it and start over
with the settings dialog.</p>
<p>If IDLE quits with no message, and it was not started from a console, try
starting it from a console or terminal (<codeclass="docutils literal notranslate"><spanclass="pre">python</span><spanclass="pre">-m</span><spanclass="pre">idlelib</span></code>) and see if
this results in an error message.</p>
<p>On Unix-based systems with tcl/tk older than <codeclass="docutils literal notranslate"><spanclass="pre">8.6.11</span></code> (see
<codeclass="docutils literal notranslate"><spanclass="pre">About</span><spanclass="pre">IDLE</span></code>) certain characters of certain fonts can cause
a tk failure with a message to the terminal. This can happen either
if one starts IDLE to edit a file with such a character or later
when entering such a character. If one cannot upgrade tcl/tk,
then re-configure IDLE to use a font that works better.</p>
<p>With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code by the default method,
directly with Python in a text-mode system console or terminal window.
However, the different interface and operation occasionally affect
visible results. For instance, <codeclass="docutils literal notranslate"><spanclass="pre">sys.modules</span></code> starts with more entries,
and <codeclass="docutils literal notranslate"><spanclass="pre">threading.active_count()</span></code> returns 2 instead of 1.</p>
<p>By default, IDLE runs user code in a separate OS process rather than in
the user interface process that runs the shell and editor. In the execution
process, it replaces <codeclass="docutils literal notranslate"><spanclass="pre">sys.stdin</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">sys.stdout</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">sys.stderr</span></code>
with objects that get input from and send output to the Shell window.
The original values stored in <codeclass="docutils literal notranslate"><spanclass="pre">sys.__stdin__</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">sys.__stdout__</span></code>, and
<codeclass="docutils literal notranslate"><spanclass="pre">sys.__stderr__</span></code> are not touched, but may be <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
<p>Sending print output from one process to a text widget in another is
slower than printing to a system terminal in the same process.
This has the most effect when printing multiple arguments, as the string
for each argument, each separator, the newline are sent separately.
For development, this is usually not a problem, but if one wants to
print faster in IDLE, format and join together everything one wants
displayed together and then print a single string. Both format strings
and <aclass="reference internal"href="stdtypes.html#str.join"title="str.join"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">str.join()</span></code></a> can help combine fields and lines.</p>
<p>IDLE’s standard stream replacements are not inherited by subprocesses
created in the execution process, whether directly by user code or by
modules such as multiprocessing. If such subprocess use <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> from
sys.stdin or <codeclass="docutils literal notranslate"><spanclass="pre">print</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">write</span></code> to sys.stdout or sys.stderr,
IDLE should be started in a command line window. (On Windows,
use <codeclass="docutils literal notranslate"><spanclass="pre">python</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">py</span></code> rather than <codeclass="docutils literal notranslate"><spanclass="pre">pythonw</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">pyw</span></code>.)
will then be attached to that window for input and output.</p>
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">sys</span></code> is reset by user code, such as with <codeclass="docutils literal notranslate"><spanclass="pre">importlib.reload(sys)</span></code>,
IDLE’s changes are lost and input from the keyboard and output to the screen
will not work correctly.</p>
<p>When Shell has the focus, it controls the keyboard and screen. This is
normally transparent, but functions that directly access the keyboard
and screen will not work. These include system-specific functions that
determine whether a key has been pressed and if so, which.</p>
<p>The IDLE code running in the execution process adds frames to the call stack
that would not be there otherwise. IDLE wraps <codeclass="docutils literal notranslate"><spanclass="pre">sys.getrecursionlimit</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">sys.setrecursionlimit</span></code> to reduce the effect of the additional stack
frames.</p>
<p>When user code raises SystemExit either directly or by calling sys.exit,
IDLE returns to a Shell prompt instead of exiting.</p>
<p>When a program outputs text, the result is determined by the
corresponding output device. When IDLE executes user code, <codeclass="docutils literal notranslate"><spanclass="pre">sys.stdout</span></code>
and <codeclass="docutils literal notranslate"><spanclass="pre">sys.stderr</span></code> are connected to the display area of IDLE’s Shell. Some of
its features are inherited from the underlying Tk Text widget. Others
are programmed additions. Where it matters, Shell is designed for development
rather than production runs.</p>
<p>For instance, Shell never throws away output. A program that sends unlimited
output to Shell will eventually fill memory, resulting in a memory error.
In contrast, some system text windows only keep the last n lines of output.
A Windows console, for instance, keeps a user-settable 1 to 9999 lines,
with 300 the default.</p>
<p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints) in
the BMP (Basic Multilingual Plane) subset of Unicode. Which characters are
displayed with a proper glyph and which with a replacement box depends on the
operating system and installed fonts. Tab characters cause the following text
to begin after the next tab stop. (They occur every 8 ‘characters’). Newline
characters cause following text to appear on a new line. Other control
characters are ignored or displayed as a space, box, or something else,
depending on the operating system and font. (Moving the text cursor through
such output with arrow keys may exhibit some surprising spacing behavior.)</p>
<divclass="highlight-python3 notranslate"><divclass="highlight"><pre><span></span><spanclass="gp">>>></span><spanclass="n">s</span><spanclass="o">=</span><spanclass="s1">'a</span><spanclass="se">\t</span><spanclass="s1">b</span><spanclass="se">\a</span><spanclass="s1"><</span><spanclass="se">\x02</span><spanclass="s1">><</span><spanclass="se">\r</span><spanclass="s1">></span><spanclass="se">\b</span><spanclass="s1">c</span><spanclass="se">\n</span><spanclass="s1">d'</span><spanclass="c1"># Enter 22 chars.</span>
<spanclass="gp">>>></span><spanclass="nb">print</span><spanclass="p">(</span><spanclass="n">s</span><spanclass="p">,</span><spanclass="n">end</span><spanclass="o">=</span><spanclass="s1">''</span><spanclass="p">)</span><spanclass="c1"># Display s as is.</span>
<spanclass="go"># Result varies by OS and font. Try it.</span>
</pre></div>
</div>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">repr</span></code> function is used for interactive echo of expression
values. It returns an altered version of the input string in which
control codes, some BMP codepoints, and all non-BMP codepoints are
replaced with escape codes. As demonstrated above, it allows one to
identify the characters in a string, regardless of how they are displayed.</p>
<p>Normal and error output are generally kept separate (on separate lines)
from code input and each other. They each get different highlight colors.</p>
<p>For SyntaxError tracebacks, the normal ‘^’ marking where the error was
detected is replaced by coloring the text with an error highlight.
When code run from a file causes other exceptions, one may right click
on a traceback line to jump to the corresponding line in an IDLE editor.
The file will be opened if necessary.</p>
<p>Shell has a special facility for squeezing output lines down to a
‘Squeezed text’ label. This is done automatically
for output over N lines (N = 50 by default).
N can be changed in the PyShell section of the General
page of the Settings dialog. Output with fewer lines can be squeezed by
right clicking on the output. This can be useful lines long enough to slow
down scrolling.</p>
<p>Squeezed output is expanded in place by double-clicking the label.
It can also be sent to the clipboard or a separate view window by
<p>IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter <codeclass="docutils literal notranslate"><spanclass="pre">import</span><spanclass="pre">tkinter</span><spanclass="pre">as</span><spanclass="pre">tk;</span>
<spanclass="pre">root</span><spanclass="pre">=</span><spanclass="pre">tk.Tk()</span></code> in standard Python and nothing appears. Enter the same
in IDLE and a tk window appears. In standard Python, one must also enter
<codeclass="docutils literal notranslate"><spanclass="pre">root.update()</span></code> to see the window. IDLE does the equivalent in the
background, about 20 times a second, which is about every 50 milliseconds.
Next enter <codeclass="docutils literal notranslate"><spanclass="pre">b</span><spanclass="pre">=</span><spanclass="pre">tk.Button(root,</span><spanclass="pre">text='button');</span><spanclass="pre">b.pack()</span></code>. Again,
nothing visibly changes in standard Python until one enters <codeclass="docutils literal notranslate"><spanclass="pre">root.update()</span></code>.</p>
<p>Most tkinter programs run <codeclass="docutils literal notranslate"><spanclass="pre">root.mainloop()</span></code>, which usually does not
return until the tk app is destroyed. If the program is run with
<codeclass="docutils literal notranslate"><spanclass="pre">python</span><spanclass="pre">-i</span></code> or from an IDLE editor, a <codeclass="docutils literal notranslate"><spanclass="pre">>>></span></code> shell prompt does not
appear until <codeclass="docutils literal notranslate"><spanclass="pre">mainloop()</span></code> returns, at which time there is nothing left
to interact with.</p>
<p>When running a tkinter program from an IDLE editor, one can comment out
the mainloop call. One then gets a shell prompt immediately and can
interact with the live application. One just has to remember to
re-enable the mainloop call when running in standard Python.</p>
<p>The Lib/idlelib package implements the IDLE application. See the rest
of this page for how to use IDLE.</p>
<p>The files in idlelib are described in idlelib/README.txt. Access it
either in idlelib or click Help => About IDLE on the IDLE menu. This
file also maps IDLE menu items to the code that implements the item.
Except for files listed under ‘Startup’, the idlelib code is ‘private’ in
sense that feature changes can be backported (see <spanclass="target"id="index-7"></span><aclass="pep reference external"href="https://peps.python.org/pep-0434/"><strong>PEP 434</strong></a>).</p>