@@ -616,23 +616,33 @@ be to delete one or more of the configuration files.</p>
<p>If IDLE quits with no message, and it was not started from a console, try
starting from a console (<codeclass="docutils literal notranslate"><spanclass="pre">python</span><spanclass="pre">-m</span><spanclass="pre">idlelib)</span></code> and see if a message appears.</p>
</div>
<divclass="section"id="idle-console-differences">
<h3>IDLE-console differences<aclass="headerlink"href="#idle-console-differences"title="Permalink to this headline">¶</a></h3>
<divclass="section"id="running-user-code">
<h3>Running user code<aclass="headerlink"href="#running-user-code"title="Permalink to this headline">¶</a></h3>
<p>With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
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.</p>
<p>IDLE also 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.
When Shell has the focus, it controls the keyboard and screen. This is
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.activeCount()</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>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. If <codeclass="docutils literal notranslate"><spanclass="pre">sys</span></code> is reset with <codeclass="docutils literal notranslate"><spanclass="pre">importlib.reload(sys)</span></code>,
IDLE’s changes are lost and things like <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">raw_input</span></code>, and
<codeclass="docutils literal notranslate"><spanclass="pre">print</span></code> will not work correctly.</p>
<p>With IDLE’s Shell, one enters, edits, and recalls complete statements.
Some consoles only work with a single physical line at a time. IDLE uses
<codeclass="docutils literal notranslate"><spanclass="pre">exec</span></code> to run each statement. As a result, <codeclass="docutils literal notranslate"><spanclass="pre">'__builtins__'</span></code> is always
defined for each statement.</p>
and screen will not work. These include system-specific functions that
determine whether a key has been pressed and if so, which.</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. The secondary subprocess
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