From 47ede24d49101468cf4712606d76e3f0de59474a Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:51:28 -0800 Subject: [PATCH] [3.14] Minor fixes to `idle.rst` and regenerate `help.html` (GH-140037) (#141121) Minor fixes to `idle.rst` and regenerate `help.html` (GH-140037) (cherry picked from commit 4e6e208be9d1c52d1b55a8bb3a83682cb078e55e) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- .gitattributes | 1 + Doc/library/idle.rst | 6 +-- Lib/idlelib/help.html | 110 ++++++++++++++++++++++++++++++------------ 3 files changed, 82 insertions(+), 35 deletions(-) diff --git a/.gitattributes b/.gitattributes index 5682b9150a36..16264cacb0e3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -83,6 +83,7 @@ Include/opcode_ids.h generated Include/token.h generated Lib/_opcode_metadata.py generated Lib/keyword.py generated +Lib/idlelib/help.html generated Lib/test/certdata/*.pem generated Lib/test/certdata/*.0 generated Lib/test/levenshtein_examples.json generated diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index e547c96b580b..10ec7f0a6f14 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -13,7 +13,7 @@ IDLE --- Python editor and shell single: Integrated Development Environment .. - Remember to update Lib/idlelib/help.html with idlelib.help.copy_source() when modifying this file. + Remember to update Lib/idlelib/help.html with idlelib.help.copy_strip() when modifying this file. -------------- @@ -88,7 +88,7 @@ Save Save As... Save the current window with a Save As dialog. The file saved becomes the - new associated file for the window. (If your file namager is set to hide + new associated file for the window. (If your file manager is set to hide extensions, the current extension will be omitted in the file name box. If the new filename has no '.', '.py' and '.txt' will be added for Python and text files, except that on macOS Aqua,'.py' is added for all files.) @@ -206,7 +206,7 @@ New Indent Width Strip Trailing Whitespace Remove trailing space and other whitespace characters after the last - non-whitespace character of a line by applying str.rstrip to each line, + non-whitespace character of a line by applying :meth:`str.rstrip` to each line, including lines within multiline strings. Except for Shell windows, remove extra newlines at the end of the file. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index ebff9a309d90..fc618ab727d1 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -53,7 +53,7 @@ and after the window title. If there is no associated file, do Save As instead.
Save the current window with a Save As dialog. The file saved becomes the -new associated file for the window. (If your file namager is set to hide +new associated file for the window. (If your file manager is set to hide extensions, the current extension will be omitted in the file name box. If the new filename has no â.â, â.pyâ and â.txtâ will be added for Python and text files, except that on macOS Aqua,â.pyâ is added for all files.)
@@ -143,8 +143,8 @@ paragraph will be formatted to less than N columns, where N defaults to 72.Open a dialog to change indent width. The accepted default by the Python community is 4 spaces.
Remove trailing space and other whitespace characters after the last -non-whitespace character of a line by applying str.rstrip to each line, +
Remove trailing space and other whitespace characters after the last
+non-whitespace character of a line by applying str.rstrip() to each line,
including lines within multiline strings. Except for Shell windows,
remove extra newlines at the end of the file.
Arrow keys move the cursor one character or line.
C-LeftArrow and C-RightArrow moves left or right one word.
C-LeftArrow and C-RightArrow moves left or right one word.
Home and End go to the beginning or end of the line.
Page Up and Page Down go up or down one screen.
C-Home and C-End go to beginning or end of the file.
Backspace and Del (or C-d) delete the previous +
C-Home and C-End go to beginning or end of the file.
Backspace and Del (or C-d) delete the previous or next character.
C-Backspace and C-Del delete one word left or right.
C-k deletes (âkillsâ) everything to the right.
C-Backspace and C-Del delete one word left or right.
C-k deletes (âkillsâ) everything to the right.
Standard keybindings (like C-c to copy and C-v to paste) +
Standard keybindings (like C-c to copy and C-v to paste) may work. Keybindings are selected in the Configure IDLE dialog.
Instead of waiting, or after a box is closed, open a completion box immediately with Show Completions on the Edit menu. The default hot -key is C-space. If one types a prefix for the desired name +key is C-space. If one types a prefix for the desired name before opening the box, the first match or near miss is made visible. The result is the same as if one enters a prefix after the box is displayed. Show Completions after a quote completes @@ -473,9 +473,9 @@ in an editor window.
The editing features described in previous subsections work when entering code interactively. IDLEâs Shell window also responds to the following:
C-c attempts to interrupt statement execution (but may fail).
C-d closes Shell if typed at a >>> prompt.
Alt-p and Alt-n (C-p and C-n on macOS) +
C-c attempts to interrupt statement execution (but may fail).
C-d closes Shell if typed at a >>> prompt.
Alt-p and Alt-n (C-p and C-n on macOS) retrieve to the current prompt the previous or next previously entered statement that matches anything already typed.
Return while the cursor is on any previous statement @@ -517,27 +517,73 @@ executed in the Tk namespace, so this file is not useful for importing functions to be used from IDLEâs Python shell.
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-
--c command run command in the shell window
--d enable debugger and open shell window
--e open editor window
--h print help message with legal combinations and exit
--i open shell window
--r file run file in shell window
--s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window
--t title set title of shell window
-- run stdin in shell (- must be last option before args)
+IDLE can be invoked from the command line with various options. The general syntax is:
+python -m idlelib [options] [file ...]
-If there are arguments:
+The following options are available:
+Run the specified Python command in the shell window.
+For example, pass -c "print('Hello, World!')".
+On Windows, the outer quotes must be double quotes as shown.
Enable the debugger and open the shell window.
+Open an editor window.
+Print a help message with legal combinations of options and exit.
+Open a shell window.
+Run the specified file in the shell window.
+Run the startup file (as defined by the environment variables IDLESTARTUP or PYTHONSTARTUP) before opening the shell window.
Set the title of the shell window.
+Read and execute standard input in the shell window. This option must be the last one before any arguments.
+If arguments are provided:
If -, -c, or r is used, all arguments are placed in
-sys.argv[1:...] and sys.argv[0] is set to '', '-c',
-or '-r'. No editor window is opened, even if that is the default
-set in the Options dialog.
Otherwise, arguments are files opened for editing and
-sys.argv reflects the arguments passed to IDLE itself.
If -, -c, or -r is used, all arguments are placed in sys.argv[1:],
+and sys.argv[0] is set to '', '-c', or '-r' respectively.
+No editor window is opened, even if that is the default set in the Options dialog.
Otherwise, arguments are treated as files to be opened for editing, and sys.argv reflects the arguments passed to IDLE itself.