Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5901b00

Browse files
committed
Merge with 3.4
2 parents 0ec69a6 + 0053c47 commit 5901b00

2 files changed

Lines changed: 50 additions & 13 deletions

File tree

Doc/library/idle.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IDLE has the following features:
1616

1717
* coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit
1818

19-
* cross-platform: works on Windows, Unix, and Mac OS X
19+
* cross-platform: works mostly the same on Windows, Unix, and Mac OS X
2020

2121
* Python shell window (interactive interpreter) with colorizing
2222
of code input, output, and error messages
@@ -492,8 +492,8 @@ Shell colors:
492492
black
493493

494494

495-
Startup
496-
-------
495+
Startup and code execution
496+
--------------------------
497497

498498
Upon startup with the ``-s`` option, IDLE will execute the file referenced by
499499
the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`.
@@ -538,10 +538,27 @@ If there are arguments:
538538
``sys.argv`` reflects the arguments passed to IDLE itself.
539539

540540

541+
IDLE-console differences
542+
^^^^^^^^^^^^^^^^^^^^^^^^
543+
544+
As much as possible, the result of executing Python code with IDLE is the
545+
same as executing the same code in a console window. However, the different
546+
interface and operation occasionally affects results.
547+
548+
For instance, IDLE normally executes user code in a separate process from
549+
the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the
550+
execution process get input from and send output to the GUI process,
551+
which keeps control of the keyboard and screen. This is normally transparent,
552+
but code that access these object will see different attribute values.
553+
Also, functions that directly access the keyboard and screen will not work.
554+
555+
With IDLE's Shell, one enters, edits, and recalls complete statements.
556+
Some consoles only work with a single physical line at a time.
557+
541558
Running without a subprocess
542559
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
543560

544-
By default, Idle executes user code in a separate subprocess via a socket,
561+
By default, IDLE executes user code in a separate subprocess via a socket,
545562
which uses the internal loopback interface. This connection is not
546563
externally visible and no data is sent to or received from the Internet.
547564
If firewall software complains anyway, you can ignore it.

Lib/idlelib/help.html

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h3>Navigation</h3>
7979
<p>IDLE has the following features:</p>
8080
<ul class="simple">
8181
<li>coded in 100% pure Python, using the <a class="reference internal" href="tkinter.html#module-tkinter" title="tkinter: Interface to Tcl/Tk for graphical user interfaces"><tt class="xref py py-mod docutils literal"><span class="pre">tkinter</span></tt></a> GUI toolkit</li>
82-
<li>cross-platform: works on Windows, Unix, and Mac OS X</li>
82+
<li>cross-platform: works mostly the same on Windows, Unix, and Mac OS X</li>
8383
<li>Python shell window (interactive interpreter) with colorizing
8484
of code input, output, and error messages</li>
8585
<li>multi-window text editor with multiple undo, Python colorizing,
@@ -223,7 +223,12 @@ <h3>25.5.1.3. Format menu (Editor window only)<a class="headerlink" href="#forma
223223
Editor window.</dd>
224224
<dt>Run Module</dt>
225225
<dd>Do Check Module (above). If no error, restart the shell to clean the
226-
environment, then execute the module.</dd>
226+
environment, then execute the module. Output is displayed in the Shell
227+
window. Note that output requires use of <tt class="docutils literal"><span class="pre">print</span></tt> or <tt class="docutils literal"><span class="pre">write</span></tt>.
228+
When execution is complete, the Shell retains focus and displays a prompt.
229+
At this point, one may interactively explore the result of execution.
230+
This is similar to executing a file with <tt class="docutils literal"><span class="pre">python</span> <span class="pre">-i</span> <span class="pre">file</span></tt> at a command
231+
line.</dd>
227232
</dl>
228233
</div>
229234
<div class="section" id="shell-menu-shell-window-only">
@@ -467,8 +472,8 @@ <h2>25.5.3. Syntax colors<a class="headerlink" href="#syntax-colors" title="Perm
467472
</dd>
468473
</dl>
469474
</div>
470-
<div class="section" id="startup">
471-
<h2>25.5.4. Startup<a class="headerlink" href="#startup" title="Permalink to this headline"></a></h2>
475+
<div class="section" id="startup-and-code-execution">
476+
<h2>25.5.4. Startup and code execution<a class="headerlink" href="#startup-and-code-execution" title="Permalink to this headline"></a></h2>
472477
<p>Upon startup with the <tt class="docutils literal"><span class="pre">-s</span></tt> option, IDLE will execute the file referenced by
473478
the environment variables <span class="target" id="index-5"></span><tt class="xref std std-envvar docutils literal"><span class="pre">IDLESTARTUP</span></tt> or <span class="target" id="index-6"></span><a class="reference internal" href="../using/cmdline.html#envvar-PYTHONSTARTUP"><tt class="xref std std-envvar docutils literal"><span class="pre">PYTHONSTARTUP</span></tt></a>.
474479
IDLE first checks for <tt class="docutils literal"><span class="pre">IDLESTARTUP</span></tt>; if <tt class="docutils literal"><span class="pre">IDLESTARTUP</span></tt> is present the file
@@ -506,9 +511,23 @@ <h3>25.5.4.1. Command line usage<a class="headerlink" href="#command-line-usage"
506511
<tt class="docutils literal"><span class="pre">sys.argv</span></tt> reflects the arguments passed to IDLE itself.</li>
507512
</ul>
508513
</div>
514+
<div class="section" id="idle-console-differences">
515+
<h3>25.5.4.2. IDLE-console differences<a class="headerlink" href="#idle-console-differences" title="Permalink to this headline"></a></h3>
516+
<p>As much as possible, the result of executing Python code with IDLE is the
517+
same as executing the same code in a console window. However, the different
518+
interface and operation occasionally affects results.</p>
519+
<p>For instance, IDLE normally executes user code in a separate process from
520+
the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the
521+
execution process get input from and send output to the GUI process,
522+
which keeps control of the keyboard and screen. This is normally transparent,
523+
but code that access these object will see different attribute values.
524+
Also, functions that directly access the keyboard and screen will not work.</p>
525+
<p>With IDLE&#8217;s Shell, one enters, edits, and recalls complete statements.
526+
Some consoles only work with a single physical line at a time.</p>
527+
</div>
509528
<div class="section" id="running-without-a-subprocess">
510-
<h3>25.5.4.2. Running without a subprocess<a class="headerlink" href="#running-without-a-subprocess" title="Permalink to this headline"></a></h3>
511-
<p>By default, Idle executes user code in a separate subprocess via a socket,
529+
<h3>25.5.4.3. Running without a subprocess<a class="headerlink" href="#running-without-a-subprocess" title="Permalink to this headline"></a></h3>
530+
<p>By default, IDLE executes user code in a separate subprocess via a socket,
512531
which uses the internal loopback interface. This connection is not
513532
externally visible and no data is sent to or received from the Internet.
514533
If firewall software complains anyway, you can ignore it.</p>
@@ -599,9 +618,10 @@ <h3><a href="../contents.html">Table Of Contents</a></h3>
599618
</ul>
600619
</li>
601620
<li><a class="reference internal" href="#syntax-colors">25.5.3. Syntax colors</a></li>
602-
<li><a class="reference internal" href="#startup">25.5.4. Startup</a><ul>
621+
<li><a class="reference internal" href="#startup-and-code-execution">25.5.4. Startup and code execution</a><ul>
603622
<li><a class="reference internal" href="#command-line-usage">25.5.4.1. Command line usage</a></li>
604-
<li><a class="reference internal" href="#running-without-a-subprocess">25.5.4.2. Running without a subprocess</a></li>
623+
<li><a class="reference internal" href="#idle-console-differences">25.5.4.2. IDLE-console differences</a></li>
624+
<li><a class="reference internal" href="#running-without-a-subprocess">25.5.4.3. Running without a subprocess</a></li>
605625
</ul>
606626
</li>
607627
<li><a class="reference internal" href="#help-and-preferences">25.5.5. Help and preferences</a><ul>
@@ -676,7 +696,7 @@ <h3>Navigation</h3>
676696
The Python Software Foundation is a non-profit corporation.
677697
<a href="https://www.python.org/psf/donations/">Please donate.</a>
678698
<br />
679-
Last updated on Sep 23, 2015.
699+
Last updated on Sep 24, 2015.
680700
<a href="../bugs.html">Found a bug</a>?
681701
<br />
682702
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2.3.

0 commit comments

Comments
 (0)