<liclass="nav-item nav-item-1"><ahref="index.html">The Python Standard Library</a>»</li>
...
...
@@ -372,8 +372,8 @@ debugger. Breakpoints for a file are saved in the user’s .idlerc directory.</
<dt>Go to file/line</dt>
<dd>Same as in Debug menu.</dd>
</dl>
<p>The Shell window also has an output squeezing facility explained in the
the <em>Python Shell window</em> subsection below.</p>
<p>The Shell window also has an output squeezing facility explained in the<em>Python
Shell window</em> subsection below.</p>
<dlclass="docutils">
<dt>Squeeze</dt>
<dd>If the cursor is over an output line, squeeze all the output between
...
...
@@ -673,24 +673,22 @@ 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 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-none notranslate"><divclass="highlight"><pre><span></span>>>> s = 'a\tb\a<\x02><\r>\bc\nd'
>>> len(s)
14
>>> s # Display repr(s)
'a\tb\x07<\x02><\r>\x08c\nd'
>>> print(s, end='') # Display s as is.
# Result varies by OS and font. Try it.
<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