From e365c4a737f98e31fc16e00edb0f7950071f96c5 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 29 Oct 2025 20:00:34 +0000 Subject: [PATCH 1/2] Commit --- Doc/library/idle.rst | 125 +++++++++++------------ Lib/idlelib/help.html | 227 +++++++++++++++++++++++++----------------- 2 files changed, 200 insertions(+), 152 deletions(-) diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index fabea611e0ebcd..cdcbf20e011987 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -45,7 +45,8 @@ possible to have multiple editor windows simultaneously. On Windows and Linux, each has its own top menu. Each menu documented below indicates which window type it is associated with. -Output windows, such as used for Edit => Find in Files, are a subtype of editor +Output windows, such as used for :menuselection:`&Edit --> Find in Files`, +are a subtype of editor window. They currently have the same top menu but a different default title and context menu. @@ -56,116 +57,116 @@ described below are moved around to conform to Apple guidelines. File menu (Shell and Editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -New File +:guilabel:`&New File` Create a new file editing window. -Open... +:guilabel:`&Open...` Open an existing file with an Open dialog. -Open Module... +:guilabel:`Open &Module...` Open an existing module (searches sys.path). -Recent Files +:guilabel:`&Recent Files` Open a list of recent files. Click one to open it. .. index:: single: Module browser single: Path browser -Module Browser +:guilabel:`Module &Browser` Show functions, classes, and methods in the current Editor file in a tree structure. In the shell, open a module first. -Path Browser +:guilabel:`&Path Browser` Show sys.path directories, modules, functions, classes and methods in a tree structure. -Save +:guilabel:`&Save` Save the current window to the associated file, if there is one. Windows that have been changed since being opened or last saved have a \* before and after the window title. If there is no associated file, do Save As instead. -Save As... +:guilabel:`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 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.) -Save Copy As... +:guilabel:`Save Cop&y As...` Save the current window to different file without changing the associated file. (See Save As note above about filename extensions.) -Print Window +:guilabel:`Prin&t Window` Print the current window to the default printer. -Close Window +:guilabel:`&Close Window` Close the current window (if an unsaved editor, ask to save; if an unsaved Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the Shell window also closes Shell. If this is the only window, also exit IDLE. -Exit IDLE +:guilabel:`E&xit IDLE` Close all windows and quit IDLE (ask to save unsaved edit windows). Edit menu (Shell and Editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Undo +:guilabel:`&Undo` Undo the last change to the current window. A maximum of 1000 changes may be undone. -Redo +:guilabel:`&Redo` Redo the last undone change to the current window. -Select All +:guilabel:`Select &All` Select the entire contents of the current window. -Cut +:guilabel:`Cu&t` Copy selection into the system-wide clipboard; then delete the selection. -Copy +:guilabel:`&Copy` Copy selection into the system-wide clipboard. -Paste +:guilabel:`&Paste` Insert contents of the system-wide clipboard into the current window. The clipboard functions are also available in context menus. -Find... +:guilabel:`&Find...` Open a search dialog with many options -Find Again +:guilabel:`Find A&gain` Repeat the last search, if there is one. -Find Selection +:guilabel:`Find &Selection` Search for the currently selected string, if there is one. -Find in Files... +:guilabel:`Find in Files...` Open a file search dialog. Put results in a new output window. -Replace... +:guilabel:`R&eplace...` Open a search-and-replace dialog. -Go to Line +:guilabel:`Go to &Line` Move the cursor to the beginning of the line requested and make that line visible. A request past the end of the file goes to the end. Clear any selection and update the line and column status. -Show Completions +:guilabel:`S&how Completions` Open a scrollable list allowing selection of existing names. See :ref:`Completions ` in the Editing and navigation section below. -Expand Word +:guilabel:`E&xpand Word` Expand a prefix you have typed to match a full word in the same window; repeat to get a different expansion. -Show Call Tip +:guilabel:`Show C&all Tip` After an unclosed parenthesis for a function, open a small window with function parameter hints. See :ref:`Calltips ` in the Editing and navigation section below. -Show Surrounding Parens +:guilabel:`Show Surrounding P&arens` Highlight the surrounding parenthesis. .. _format-menu: @@ -173,38 +174,38 @@ Show Surrounding Parens Format menu (Editor window only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format Paragraph +:guilabel:`F&ormat Paragraph` Reformat the current blank-line-delimited paragraph in comment block or multiline string or selected line in a string. All lines in the paragraph will be formatted to less than N columns, where N defaults to 72. -Indent Region +:guilabel:`&Indent Region` Shift selected lines right by the indent width (default 4 spaces). -Dedent Region +:guilabel:`&Dedent Region` Shift selected lines left by the indent width (default 4 spaces). -Comment Out Region +:guilabel:`Comment &Out Region` Insert ## in front of selected lines. -Uncomment Region +:guilabel:`U&ncomment Region` Remove leading # or ## from selected lines. -Tabify Region +:guilabel:`Tabify Region` Turn *leading* stretches of spaces into tabs. (Note: We recommend using 4 space blocks to indent Python code.) -Untabify Region +:guilabel:`Untabify Region` Turn *all* tabs into the correct number of spaces. -Toggle Tabs +:guilabel:`Toggle Tabs` Open a dialog to switch between indenting with spaces and tabs. -New Indent Width +:guilabel:`New Indent Width` Open a dialog to change indent width. The accepted default by the Python community is 4 spaces. -Strip Trailing Chitespace +:guilabel:`S&trip 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, including lines within multiline strings. Except for Shell windows, @@ -218,7 +219,7 @@ Run menu (Editor window only) .. _run-module: -Run Module +:guilabel:`R&un Module` Do :ref:`Check Module `. If no error, restart the shell to clean the environment, then execute the module. Output is displayed in the Shell window. Note that output requires use of ``print`` or ``write``. @@ -229,14 +230,14 @@ Run Module .. _run-custom: -Run... Customized +:guilabel:`Run... &Customized` Same as :ref:`Run Module `, but run the module with customized settings. *Command Line Arguments* extend :data:`sys.argv` as if passed on a command line. The module can be run in the Shell without restarting. .. _check-module: -Check Module +:guilabel:`C&heck Module` Check the syntax of the module currently open in the Editor window. If the module has not been saved IDLE will either prompt the user to save or autosave, as selected in the General tab of the Idle Settings dialog. If @@ -245,32 +246,32 @@ Check Module .. _python-shell: -Python Shell +:guilabel:`Python Shell` Open or wake up the Python Shell window. Shell menu (Shell window only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -View Last Restart +:guilabel:`&View Last Restart` Scroll the shell window to the last Shell restart. -Restart Shell +:guilabel:`&Restart Shell` Restart the shell to clean the environment and reset display and exception handling. -Previous History +:guilabel:`&Previous History` Cycle through earlier commands in history which match the current entry. -Next History +:guilabel:`&Next History` Cycle through later commands in history which match the current entry. -Interrupt Execution +:guilabel:`&Interrupt Execution` Stop a running program. Debug menu (Shell window only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Go to File/Line +:guilabel:`&Go to File/Line` Look on the current line. with the cursor, and the line above for a filename and line number. If found, open the file if not already open, and show the line. Use this to view source lines referenced in an exception traceback @@ -281,22 +282,22 @@ Go to File/Line single: debugger single: stack viewer -Debugger (toggle) +:guilabel:`&Debugger` (toggle) When activated, code entered in the Shell or run from an Editor will run under the debugger. In the Editor, breakpoints can be set with the context menu. This feature is still incomplete and somewhat experimental. -Stack Viewer +:guilabel:`&Stack Viewer` Show the stack traceback of the last exception in a tree widget, with access to locals and globals. -Auto-open Stack Viewer +:guilabel:`&Auto-open Stack Viewer` Toggle automatically opening the stack viewer on an unhandled exception. Options menu (Shell and Editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Configure IDLE +:guilabel:`Configure &IDLE` Open a configuration dialog and change preferences for the following: fonts, indentation, keybindings, text color themes, startup windows and size, additional help sources, and extensions. On macOS, open the @@ -307,18 +308,18 @@ Configure IDLE Most configuration options apply to all windows or all future windows. The option items below only apply to the active window. -Show/Hide Code Context (Editor Window only) +:guilabel:`Show/Hide &Code Context` (Editor Window only) Open a pane at the top of the edit window which shows the block context of the code which has scrolled above the top of the window. See :ref:`Code Context ` in the Editing and Navigation section below. -Show/Hide Line Numbers (Editor Window only) +:guilabel:`Show/Hide &Line Numbers` (Editor Window only) Open a column to the left of the edit window which shows the number of each line of text. The default is off, which may be changed in the preferences (see :ref:`Setting preferences `). -Zoom/Restore Height +:guilabel:`&Zoom/Restore Height` Toggles the window between normal size and maximum height. The initial size defaults to 40 lines by 80 chars unless changed on the General tab of the Configure IDLE dialog. The maximum height for a screen is determined by @@ -335,18 +336,18 @@ Lists the names of all open windows; select one to bring it to the foreground Help menu (Shell and Editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -About IDLE +:guilabel:`&About IDLE` Display version, copyright, license, credits, and more. -IDLE Help +:guilabel:`&IDLE Help` Display this IDLE document, detailing the menu options, basic editing and navigation, and other tips. -Python Docs +:guilabel:`Python &Docs` Access local Python documentation, if installed, or start a web browser and open docs.python.org showing the latest Python documentation. -Turtle Demo +:guilabel:`Turtle Demo` Run the turtledemo module with example Python code and turtle drawings. Additional help sources may be added here with the Configure IDLE dialog under @@ -362,7 +363,7 @@ for more on Help menu choices. single: breakpoints Context menus -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^ Open a context menu by right-clicking in a window (Control-click on macOS). Context menus have the standard clipboard functions also on the Edit menu. @@ -1020,7 +1021,7 @@ The Lib/idlelib package implements the IDLE application. See the rest of this page for how to use IDLE. The files in idlelib are described in idlelib/README.txt. Access it -either in idlelib or click Help => About IDLE on the IDLE menu. This +either in idlelib or click :menuselection:`&Help --> &About IDLE` on the IDLE menu. This file also maps IDLE menu items to the code that implements the item. Except for files listed under 'Startup', the idlelib code is 'private' in sense that feature changes can be backported (see :pep:`434`). diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index ebff9a309d9081..dc728522602c7e 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -22,7 +22,8 @@

Menus possible to have multiple editor windows simultaneously. On Windows and Linux, each has its own top menu. Each menu documented below indicates which window type it is associated with.

-

Output windows, such as used for Edit => Find in Files, are a subtype of editor +

Output windows, such as used for Edit ‣ Find in Files, +are a subtype of editor window. They currently have the same top menu but a different default title and context menu.

On macOS, there is one application menu. It dynamically changes according @@ -31,119 +32,119 @@

Menus

File menu (Shell and Editor)

-
New File

Create a new file editing window.

+
New File

Create a new file editing window.

-
Open…

Open an existing file with an Open dialog.

+
Open…

Open an existing file with an Open dialog.

-
Open Module…

Open an existing module (searches sys.path).

+
Open Module…

Open an existing module (searches sys.path).

-
Recent Files

Open a list of recent files. Click one to open it.

+
Recent Files

Open a list of recent files. Click one to open it.

-
Module Browser

Show functions, classes, and methods in the current Editor file in a +

Module Browser

Show functions, classes, and methods in the current Editor file in a tree structure. In the shell, open a module first.

-
Path Browser

Show sys.path directories, modules, functions, classes and methods in a +

Path Browser

Show sys.path directories, modules, functions, classes and methods in a tree structure.

-
Save

Save the current window to the associated file, if there is one. Windows +

Save

Save the current window to the associated file, if there is one. Windows that have been changed since being opened or last saved have a * before and after the window title. If there is no associated file, do Save As instead.

-
Save As…

Save the current window with a Save As dialog. The file saved becomes the +

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 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.)

-
Save Copy As…

Save the current window to different file without changing the associated +

Save Copy As…

Save the current window to different file without changing the associated file. (See Save As note above about filename extensions.)

-
Print Window

Print the current window to the default printer.

+
Print Window

Print the current window to the default printer.

-
Close Window

Close the current window (if an unsaved editor, ask to save; if an unsaved +

Close Window

Close the current window (if an unsaved editor, ask to save; if an unsaved Shell, ask to quit execution). Calling exit() or close() in the Shell window also closes Shell. If this is the only window, also exit IDLE.

-
Exit IDLE

Close all windows and quit IDLE (ask to save unsaved edit windows).

+
Exit IDLE

Close all windows and quit IDLE (ask to save unsaved edit windows).

Edit menu (Shell and Editor)

-
Undo

Undo the last change to the current window. A maximum of 1000 changes may +

Undo

Undo the last change to the current window. A maximum of 1000 changes may be undone.

-
Redo

Redo the last undone change to the current window.

+
Redo

Redo the last undone change to the current window.

-
Select All

Select the entire contents of the current window.

+
Select All

Select the entire contents of the current window.

-
Cut

Copy selection into the system-wide clipboard; then delete the selection.

+
Cut

Copy selection into the system-wide clipboard; then delete the selection.

-
Copy

Copy selection into the system-wide clipboard.

+
Copy

Copy selection into the system-wide clipboard.

-
Paste

Insert contents of the system-wide clipboard into the current window.

+
Paste

Insert contents of the system-wide clipboard into the current window.

The clipboard functions are also available in context menus.

-
Find…

Open a search dialog with many options

+
Find…

Open a search dialog with many options

-
Find Again

Repeat the last search, if there is one.

+
Find Again

Repeat the last search, if there is one.

-
Find Selection

Search for the currently selected string, if there is one.

+
Find Selection

Search for the currently selected string, if there is one.

-
Find in Files…

Open a file search dialog. Put results in a new output window.

+
Find in Files…

Open a file search dialog. Put results in a new output window.

-
Replace…

Open a search-and-replace dialog.

+
Replace…

Open a search-and-replace dialog.

-
Go to Line

Move the cursor to the beginning of the line requested and make that +

Go to Line

Move the cursor to the beginning of the line requested and make that line visible. A request past the end of the file goes to the end. Clear any selection and update the line and column status.

-
Show Completions

Open a scrollable list allowing selection of existing names. See +

Show Completions

Open a scrollable list allowing selection of existing names. See Completions in the Editing and navigation section below.

-
Expand Word

Expand a prefix you have typed to match a full word in the same window; +

Expand Word

Expand a prefix you have typed to match a full word in the same window; repeat to get a different expansion.

-
Show Call Tip

After an unclosed parenthesis for a function, open a small window with +

Show Call Tip

After an unclosed parenthesis for a function, open a small window with function parameter hints. See Calltips in the Editing and navigation section below.

-
Show Surrounding Parens

Highlight the surrounding parenthesis.

+
Show Surrounding Parens

Highlight the surrounding parenthesis.

Format menu (Editor window only)

-
Format Paragraph

Reformat the current blank-line-delimited paragraph in comment block or +

Format Paragraph

Reformat the current blank-line-delimited paragraph in comment block or multiline string or selected line in a string. All lines in the paragraph will be formatted to less than N columns, where N defaults to 72.

-
Indent Region

Shift selected lines right by the indent width (default 4 spaces).

+
Indent Region

Shift selected lines right by the indent width (default 4 spaces).

-
Dedent Region

Shift selected lines left by the indent width (default 4 spaces).

+
Dedent Region

Shift selected lines left by the indent width (default 4 spaces).

-
Comment Out Region

Insert ## in front of selected lines.

+
Comment Out Region

Insert ## in front of selected lines.

-
Uncomment Region

Remove leading # or ## from selected lines.

+
Uncomment Region

Remove leading # or ## from selected lines.

-
Tabify Region

Turn leading stretches of spaces into tabs. (Note: We recommend using +

Tabify Region

Turn leading stretches of spaces into tabs. (Note: We recommend using 4 space blocks to indent Python code.)

-
Untabify Region

Turn all tabs into the correct number of spaces.

+
Untabify Region

Turn all tabs into the correct number of spaces.

-
Toggle Tabs

Open a dialog to switch between indenting with spaces and tabs.

+
Toggle Tabs

Open a dialog to switch between indenting with spaces and tabs.

-
New Indent Width

Open a dialog to change indent width. The accepted default by the Python +

New Indent Width

Open a dialog to change indent width. The accepted default by the Python community is 4 spaces.

-
Strip Trailing Chitespace

Remove trailing space and other whitespace characters after the last +

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, including lines within multiline strings. Except for Shell windows, remove extra newlines at the end of the file.

@@ -153,7 +154,7 @@

Edit menu (Shell and Editor)

Run menu (Editor window only)

-
Run Module

Do Check Module. If no error, restart the shell to clean the +

Run Module

Do Check Module. If no error, restart the shell to clean the environment, then execute the module. Output is displayed in the Shell window. Note that output requires use of print or write. When execution is complete, the Shell retains focus and displays a prompt. @@ -163,13 +164,13 @@

Edit menu (Shell and Editor) -
Run… Customized

Same as Run Module, but run the module with customized +

Run… Customized

Same as Run Module, but run the module with customized settings. Command Line Arguments extend sys.argv as if passed on a command line. The module can be run in the Shell without restarting.

-
Check Module

Check the syntax of the module currently open in the Editor window. If the +

Check Module

Check the syntax of the module currently open in the Editor window. If the module has not been saved IDLE will either prompt the user to save or autosave, as selected in the General tab of the Idle Settings dialog. If there is a syntax error, the approximate location is indicated in the @@ -177,29 +178,29 @@

Edit menu (Shell and Editor) -
Python Shell

Open or wake up the Python Shell window.

+
Python Shell

Open or wake up the Python Shell window.

Shell menu (Shell window only)

-
View Last Restart

Scroll the shell window to the last Shell restart.

+
View Last Restart

Scroll the shell window to the last Shell restart.

-
Restart Shell

Restart the shell to clean the environment and reset display and exception handling.

+
Restart Shell

Restart the shell to clean the environment and reset display and exception handling.

-
Previous History

Cycle through earlier commands in history which match the current entry.

+
Previous History

Cycle through earlier commands in history which match the current entry.

-
Next History

Cycle through later commands in history which match the current entry.

+
Next History

Cycle through later commands in history which match the current entry.

-
Interrupt Execution

Stop a running program.

+
Interrupt Execution

Stop a running program.

Debug menu (Shell window only)

-
Go to File/Line

Look on the current line. with the cursor, and the line above for a filename +

Go to File/Line

Look on the current line. with the cursor, and the line above for a filename and line number. If found, open the file if not already open, and show the line. Use this to view source lines referenced in an exception traceback and lines found by Find in Files. Also available in the context menu of @@ -207,21 +208,21 @@

Debug menu (Shell window only) -
Debugger (toggle)

When activated, code entered in the Shell or run from an Editor will run +

Debugger (toggle)

When activated, code entered in the Shell or run from an Editor will run under the debugger. In the Editor, breakpoints can be set with the context menu. This feature is still incomplete and somewhat experimental.

-
Stack Viewer

Show the stack traceback of the last exception in a tree widget, with +

Stack Viewer

Show the stack traceback of the last exception in a tree widget, with access to locals and globals.

-
Auto-open Stack Viewer

Toggle automatically opening the stack viewer on an unhandled exception.

+
Auto-open Stack Viewer

Toggle automatically opening the stack viewer on an unhandled exception.

Options menu (Shell and Editor)

-
Configure IDLE

Open a configuration dialog and change preferences for the following: +

Configure IDLE

Open a configuration dialog and change preferences for the following: fonts, indentation, keybindings, text color themes, startup windows and size, additional help sources, and extensions. On macOS, open the configuration dialog by selecting Preferences in the application @@ -232,16 +233,16 @@

Options menu (Shell and Editor) -
Show/Hide Code Context (Editor Window only)

Open a pane at the top of the edit window which shows the block context +

Show/Hide Code Context (Editor Window only)

Open a pane at the top of the edit window which shows the block context of the code which has scrolled above the top of the window. See Code Context in the Editing and Navigation section below.

-
Show/Hide Line Numbers (Editor Window only)

Open a column to the left of the edit window which shows the number +

Show/Hide Line Numbers (Editor Window only)

Open a column to the left of the edit window which shows the number of each line of text. The default is off, which may be changed in the preferences (see Setting preferences).

-
Zoom/Restore Height

Toggles the window between normal size and maximum height. The initial size +

Zoom/Restore Height

Toggles the window between normal size and maximum height. The initial size defaults to 40 lines by 80 chars unless changed on the General tab of the Configure IDLE dialog. The maximum height for a screen is determined by momentarily maximizing a window the first time one is zoomed on the screen. @@ -258,15 +259,15 @@

Window menu (Shell and Editor)

Help menu (Shell and Editor)

-
About IDLE

Display version, copyright, license, credits, and more.

+
About IDLE

Display version, copyright, license, credits, and more.

-
IDLE Help

Display this IDLE document, detailing the menu options, basic editing and +

IDLE Help

Display this IDLE document, detailing the menu options, basic editing and navigation, and other tips.

-
Python Docs

Access local Python documentation, if installed, or start a web browser +

Python Docs

Access local Python documentation, if installed, or start a web browser and open docs.python.org showing the latest Python documentation.

-
Turtle Demo

Run the turtledemo module with example Python code and turtle drawings.

+
Turtle Demo

Run the turtledemo module with example Python code and turtle drawings.

Additional help sources may be added here with the Configure IDLE dialog under @@ -337,16 +338,16 @@

Key bindings
  • 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.

    @@ -390,7 +391,7 @@

    Search and ReplaceC-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 +474,9 @@

    Shell window -
  • 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 +518,73 @@

    Startup and Code Execution

    Command line usage

    -
    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:

    +
    +
    +-c <command>
    +

    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.

    +
    + +
    +
    +-d
    +

    Enable the debugger and open the shell window.

    +
    + +
    +
    +-e
    +

    Open an editor window.

    +
    + +
    +
    +-h
    +

    Print a help message with legal combinations of options and exit.

    +
    + +
    +
    +-i
    +

    Open a shell window.

    +
    + +
    +
    +-r <file>
    +

    Run the specified file in the shell window.

    +
    + +
    +
    +-s
    +

    Run the startup file (as defined by the environment variables IDLESTARTUP or PYTHONSTARTUP) before opening the shell window.

    +
    + +
    +
    +-t <title>
    +

    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.

  • @@ -795,10 +842,10 @@

    ExtensionsHelp ‣ About IDLE on the IDLE menu. This file also maps IDLE menu items to the code that implements the item. Except for files listed under ‘Startup’, the idlelib code is ‘private’ in -sense that feature changes can be backported (see PEP 434).

    +sense that feature changes can be backported (see PEP 434).

    From 28635938ec2d3822fa01622833511ace8d3691ce Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 10 Nov 2025 19:39:38 +0000 Subject: [PATCH 2/2] Update --- Doc/library/idle.rst | 3 +- Lib/idlelib/help.html | 132 ++++++++++++++++++++++-------------------- Lib/idlelib/help.py | 3 + 3 files changed, 75 insertions(+), 63 deletions(-) diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 41bea6d9145b06..a9c6e61ba9a33d 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -349,7 +349,8 @@ Help menu (Shell and Editor) :guilabel:`Python &Docs` Access local Python documentation, if installed, or start a web browser - and open docs.python.org showing the latest Python documentation. + and open `docs.python.org `_ showing the latest + Python documentation. :guilabel:`Turtle Demo` Run the turtledemo module with example Python code and turtle drawings. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index fc618ab727d1fb..c1709a39a06003 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -16,13 +16,20 @@ of global and local namespaces

  • configuration, browsers, and other dialogs

  • +

    The IDLE application is implemented in the idlelib package.

    +

    This is an optional module. +If it is missing from your copy of CPython, +look for documentation from your distributor (that is, +whoever provided Python to you). +If you are the distributor, see Requirements for optional modules.