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
Copy file name to clipboardExpand all lines: Lib/idlelib/help.html
+78-32Lines changed: 78 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ <h3>File menu (Shell and Editor)<a class="headerlink" href="#file-menu-shell-and
53
53
do Save As instead.</p>
54
54
</dd>
55
55
<dt>Save As…</dt><dd><p>Save the current window with a Save As dialog. The file saved becomes the
56
-
new associated file for the window. (If your file namager is set to hide
56
+
new associated file for the window. (If your file manager is set to hide
57
57
extensions, the current extension will be omitted in the file name box.
58
58
If the new filename has no ‘.’, ‘.py’ and ‘.txt’ will be added for Python
59
59
and text files, except that on macOS Aqua,’.py’ is added for all files.)</p>
@@ -143,8 +143,8 @@ <h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and
143
143
<dt>New Indent Width</dt><dd><p>Open a dialog to change indent width. The accepted default by the Python
144
144
community is 4 spaces.</p>
145
145
</dd>
146
-
<dt>Strip Trailing Chitespace</dt><dd><p>Remove trailing space and other whitespace characters after the last
147
-
non-whitespace character of a line by applying str.rstrip to each line,
146
+
<dt>Strip Trailing Whitespace</dt><dd><p>Remove trailing space and other whitespace characters after the last
147
+
non-whitespace character of a line by applying <aclass="reference internal" href="stdtypes.html#str.rstrip" title="str.rstrip"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">str.rstrip()</span></code></a> to each line,
148
148
including lines within multiline strings. Except for Shell windows,
149
149
remove extra newlines at the end of the file.</p>
150
150
</dd>
@@ -337,16 +337,16 @@ <h3>Key bindings<a class="headerlink" href="#key-bindings" title="Link to this h
337
337
assume that the keys have not been re-bound to something else.)</p>
338
338
<ulclass="simple">
339
339
<li><p>Arrow keys move the cursor one character or line.</p></li>
340
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">LeftArrow</kbd></kbd> and <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">RightArrow</kbd></kbd> moves left or right one word.</p></li>
340
+
<li><p><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">LeftArrow</kbd> and <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">RightArrow</kbd> moves left or right one word.</p></li>
341
341
<li><p><kbdclass="kbd docutils literal notranslate">Home</kbd> and <kbdclass="kbd docutils literal notranslate">End</kbd> go to the beginning or end of the line.</p></li>
342
342
<li><p><kbdclass="kbd docutils literal notranslate">Page Up</kbd> and <kbdclass="kbd docutils literal notranslate">Page Down</kbd> go up or down one screen.</p></li>
343
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Home</kbd></kbd> and <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">End</kbd></kbd> go to beginning or end of the file.</p></li>
<li><p><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Home</kbd> and <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">End</kbd> go to beginning or end of the file.</p></li>
344
+
<li><p><kbdclass="kbd docutils literal notranslate">Backspace</kbd> and <kbdclass="kbd docutils literal notranslate">Del</kbd> (or <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">d</kbd>) delete the previous
345
345
or next character.</p></li>
346
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Backspace</kbd></kbd> and <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Del</kbd></kbd> delete one word left or right.</p></li>
347
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">k</kbd></kbd> deletes (‘kills’) everything to the right.</p></li>
346
+
<li><p><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Backspace</kbd> and <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">Del</kbd> delete one word left or right.</p></li>
347
+
<li><p><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">k</kbd> deletes (‘kills’) everything to the right.</p></li>
348
348
</ul>
349
-
<p>Standard keybindings (like <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">c</kbd></kbd> to copy and <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">v</kbd></kbd> to paste)
349
+
<p>Standard keybindings (like <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">c</kbd> to copy and <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">v</kbd> to paste)
350
350
may work. Keybindings are selected in the Configure IDLE dialog.</p>
351
351
</section>
352
352
<sectionid="automatic-indentation">
@@ -390,7 +390,7 @@ <h3>Search and Replace<a class="headerlink" href="#search-and-replace" title="Li
390
390
directory name and a separator.</p>
391
391
<p>Instead of waiting, or after a box is closed, open a completion box
392
392
immediately with Show Completions on the Edit menu. The default hot
393
-
key is <kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">space</kbd></kbd>. If one types a prefix for the desired name
393
+
key is <kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">space</kbd>. If one types a prefix for the desired name
394
394
before opening the box, the first match or near miss is made visible.
395
395
The result is the same as if one enters a prefix
396
396
after the box is displayed. Show Completions after a quote completes
@@ -473,9 +473,9 @@ <h3>Shell window<a class="headerlink" href="#shell-window" title="Link to this h
473
473
<p>The editing features described in previous subsections work when entering
474
474
code interactively. IDLE’s Shell window also responds to the following:</p>
475
475
<ulclass="simple">
476
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">c</kbd></kbd> attempts to interrupt statement execution (but may fail).</p></li>
477
-
<li><p><kbdclass="kbd compound docutils literal notranslate"><kbdclass="kbd docutils literal notranslate">C</kbd>-<kbdclass="kbd docutils literal notranslate">d</kbd></kbd> closes Shell if typed at a <codeclass="docutils literal notranslate"><spanclass="pre">>>></span></code> prompt.</p></li>
<spanclass="sig-name descname"><spanclass="pre">-c</span></span><spanclass="sig-prename descclassname"><spanclass="pre"><command></span></span><aclass="headerlink" href="#cmdoption-idle-c" title="Link to this definition">¶</a></dt>
528
+
<dd><p>Run the specified Python command in the shell window.
529
+
For example, pass <codeclass="docutils literal notranslate"><spanclass="pre">-c</span><spanclass="pre">"print('Hello,</span><spanclass="pre">World!')"</span></code>.
530
+
On Windows, the outer quotes must be double quotes as shown.</p>
<spanclass="sig-name descname"><spanclass="pre">-d</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-d" title="Link to this definition">¶</a></dt>
536
+
<dd><p>Enable the debugger and open the shell window.</p>
<spanclass="sig-name descname"><spanclass="pre">-e</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-e" title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">-h</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-h" title="Link to this definition">¶</a></dt>
548
+
<dd><p>Print a help message with legal combinations of options and exit.</p>
<spanclass="sig-name descname"><spanclass="pre">-i</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-i" title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">-r</span></span><spanclass="sig-prename descclassname"><spanclass="pre"><file></span></span><aclass="headerlink" href="#cmdoption-idle-r" title="Link to this definition">¶</a></dt>
560
+
<dd><p>Run the specified file in the shell window.</p>
<spanclass="sig-name descname"><spanclass="pre">-s</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-s" title="Link to this definition">¶</a></dt>
566
+
<dd><p>Run the startup file (as defined by the environment variables <spanclass="target" id="index-7"></span><codeclass="xref std std-envvar docutils literal notranslate"><spanclass="pre">IDLESTARTUP</span></code> or <spanclass="target" id="index-8"></span><aclass="reference internal" href="../using/cmdline.html#envvar-PYTHONSTARTUP"><codeclass="xref std std-envvar docutils literal notranslate"><spanclass="pre">PYTHONSTARTUP</span></code></a>) before opening the shell window.</p>
<spanclass="sig-name descname"><spanclass="pre">-t</span></span><spanclass="sig-prename descclassname"><spanclass="pre"><title></span></span><aclass="headerlink" href="#cmdoption-idle-t" title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">-</span></span><spanclass="sig-prename descclassname"></span><aclass="headerlink" href="#cmdoption-idle-0" title="Link to this definition">¶</a></dt>
578
+
<dd><p>Read and execute standard input in the shell window. This option must be the last one before any arguments.</p>
579
+
</dd></dl>
580
+
581
+
<p>If arguments are provided:</p>
534
582
<ulclass="simple">
535
-
<li><p>If <codeclass="docutils literal notranslate"><spanclass="pre">-</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">-c</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">r</span></code> is used, all arguments are placed in
536
-
<codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[1:...]</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[0]</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">''</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">'-c'</span></code>,
537
-
or <codeclass="docutils literal notranslate"><spanclass="pre">'-r'</span></code>. No editor window is opened, even if that is the default
538
-
set in the Options dialog.</p></li>
539
-
<li><p>Otherwise, arguments are files opened for editing and
540
-
<codeclass="docutils literal notranslate"><spanclass="pre">sys.argv</span></code> reflects the arguments passed to IDLE itself.</p></li>
583
+
<li><p>If <codeclass="docutils literal notranslate"><spanclass="pre">-</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">-c</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">-r</span></code> is used, all arguments are placed in <codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[1:]</span></code>,
584
+
and <codeclass="docutils literal notranslate"><spanclass="pre">sys.argv[0]</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">''</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">'-c'</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">'-r'</span></code> respectively.
585
+
No editor window is opened, even if that is the default set in the <em>Options</em> dialog.</p></li>
586
+
<li><p>Otherwise, arguments are treated as files to be opened for editing, and <codeclass="docutils literal notranslate"><spanclass="pre">sys.argv</span></code> reflects the arguments passed to IDLE itself.</p></li>
541
587
</ul>
542
588
</section>
543
589
<sectionid="startup-failure">
@@ -798,7 +844,7 @@ <h3>Extensions<a class="headerlink" href="#extensions" title="Link to this headi
798
844
either in idlelib or click Help => About IDLE on the IDLE menu. This
799
845
file also maps IDLE menu items to the code that implements the item.
800
846
Except for files listed under ‘Startup’, the idlelib code is ‘private’ in
801
-
sense that feature changes can be backported (see <spanclass="target" id="index-7"></span><aclass="pep reference external" href="https://peps.python.org/pep-0434/"><strong>PEP 434</strong></a>).</p>
847
+
sense that feature changes can be backported (see <spanclass="target" id="index-9"></span><aclass="pep reference external" href="https://peps.python.org/pep-0434/"><strong>PEP 434</strong></a>).</p>
0 commit comments