You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Printing to IDLE's Shell is often slower than printing to a system
terminal, but it can be made faster by pre-formatting a single
string before printing.
(cherry picked from commit 2827e8a)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Copy file name to clipboardExpand all lines: Lib/idlelib/help.html
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -679,6 +679,14 @@ <h3>Running user code<a class="headerlink" href="#running-user-code" title="Perm
679
679
with objects that get input from and send output to the Shell window.
680
680
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
681
681
<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>
682
+
<p>Sending print output from one process to a text widget in another is
683
+
slower than printing to a system terminal in the same process.
684
+
This has the most effect when printing multiple arguments, as the string
685
+
for each argument, each separator, the newline are sent separately.
686
+
For development, this is usually not a problem, but if one wants to
687
+
print faster in IDLE, format and join together everything one wants
688
+
displayed together and then print a single string. Both format strings
689
+
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>
682
690
<p>IDLE’s standard stream replacements are not inherited by subprocesses
683
691
created in the execution process, whether directly by user code or by
684
692
modules such as multiprocessing. If such subprocess use <codeclass="docutils literal notranslate"><spanclass="pre">input</span></code> from
@@ -982,7 +990,7 @@ <h3>Navigation</h3>
982
990
<br/>
983
991
<br/>
984
992
985
-
Last updated on Feb 21, 2021.
993
+
Last updated on Feb 23, 2021.
986
994
<ahref="https://docs.python.org/3/bugs.html">Found a bug</a>?
0 commit comments