bpo-35099: Update idlelib/help.html (#10353)

(This should have been done with the first PR for this issue.)
This commit is contained in:
Terry Jan Reedy 2018-11-05 22:17:57 -05:00 committed by GitHub
parent 5e79090324
commit f1d3efc2fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 <p>If IDLE quits with no message, and it was not started from a console, try
starting from a console (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib)</span></code> and see if a message appears.</p> starting from a console (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib)</span></code> and see if a message appears.</p>
</div> </div>
<div class="section" id="idle-console-differences"> <div class="section" id="running-user-code">
<h3>IDLE-console differences<a class="headerlink" href="#idle-console-differences" title="Permalink to this headline"></a></h3> <h3>Running user code<a class="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 <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 However, the different interface and operation occasionally affect
visible results. For instance, <code class="docutils literal notranslate"><span class="pre">sys.modules</span></code> starts with more entries.</p> visible results. For instance, <code class="docutils literal notranslate"><span class="pre">sys.modules</span></code> starts with more entries,
<p>IDLE also 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> with and <code class="docutils literal notranslate"><span class="pre">threading.activeCount()</span></code> returns 2 instead of 1.</p>
objects that get input from and send output to the Shell window. <p>By default, IDLE runs user code in a separate OS process rather than in
When Shell has the focus, it controls the keyboard and screen. This is the user interface process that runs the shell and editor. In the execution
process, 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>
with objects that get input from and send output to the Shell window.
The 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
<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>
<p>When Shell has the focus, it controls the keyboard and screen. This is
normally transparent, but functions that directly access the keyboard normally transparent, but functions that directly access the keyboard
and screen will not work. If <code class="docutils literal notranslate"><span class="pre">sys</span></code> is reset with <code class="docutils literal notranslate"><span class="pre">importlib.reload(sys)</span></code>, and screen will not work. These include system-specific functions that
IDLEs changes are lost and things like <code class="docutils literal notranslate"><span class="pre">input</span></code>, <code class="docutils literal notranslate"><span class="pre">raw_input</span></code>, and determine whether a key has been pressed and if so, which.</p>
<code class="docutils literal notranslate"><span class="pre">print</span></code> will not work correctly.</p> <p>IDLEs standard stream replacements are not inherited by subprocesses
<p>With IDLEs Shell, one enters, edits, and recalls complete statements. created in the execution process, whether directly by user code or by modules
Some consoles only work with a single physical line at a time. IDLE uses such as multiprocessing. If such subprocess use <code class="docutils literal notranslate"><span class="pre">input</span></code> from sys.stdin
<code class="docutils literal notranslate"><span class="pre">exec</span></code> to run each statement. As a result, <code class="docutils literal notranslate"><span class="pre">'__builtins__'</span></code> is always 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,
defined for each statement.</p> 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 <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>,
IDLEs changes are lost and input from the keyboard and output to the screen
will not work correctly.</p>
</div> </div>
<div class="section" id="developing-tkinter-applications"> <div class="section" id="developing-tkinter-applications">
<h3>Developing tkinter applications<a class="headerlink" href="#developing-tkinter-applications" title="Permalink to this headline"></a></h3> <h3>Developing tkinter applications<a class="headerlink" href="#developing-tkinter-applications" title="Permalink to this headline"></a></h3>
@ -752,7 +762,7 @@ also used for testing.</p>
<li><a class="reference internal" href="#startup-and-code-execution">Startup and code execution</a><ul> <li><a class="reference internal" href="#startup-and-code-execution">Startup and code execution</a><ul>
<li><a class="reference internal" href="#command-line-usage">Command line usage</a></li> <li><a class="reference internal" href="#command-line-usage">Command line usage</a></li>
<li><a class="reference internal" href="#startup-failure">Startup failure</a></li> <li><a class="reference internal" href="#startup-failure">Startup failure</a></li>
<li><a class="reference internal" href="#idle-console-differences">IDLE-console differences</a></li> <li><a class="reference internal" href="#running-user-code">Running user code</a></li>
<li><a class="reference internal" href="#developing-tkinter-applications">Developing tkinter applications</a></li> <li><a class="reference internal" href="#developing-tkinter-applications">Developing tkinter applications</a></li>
<li><a class="reference internal" href="#running-without-a-subprocess">Running without a subprocess</a></li> <li><a class="reference internal" href="#running-without-a-subprocess">Running without a subprocess</a></li>
</ul> </ul>
@ -841,7 +851,7 @@ also used for testing.</p>
<br /> <br />
<br /> <br />
Last updated on Oct 28, 2018. Last updated on Nov 05, 2018.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>? <a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br /> <br />