- -
-

IDLE

-

Source code: Lib/idlelib/

-
+
+

IDLE — Python editor and shell

+

Source code: Lib/idlelib/

+

IDLE is Python’s Integrated Development and Learning Environment.

IDLE has the following features:

    @@ -238,7 +17,7 @@ of global and local namespaces

  • configuration, browsers, and other dialogs

-

Editing and Navigation

+

Editing and Navigation

-

Editor windows

+

Editor windows

IDLE may open editor windows when it starts, depending on settings and how you start IDLE. Thereafter, use the File menu. There can be only one open editor window for a given file.

@@ -545,7 +324,7 @@ column numbers with 0.

and that other files do not. Run Python code with the Run menu.

-

Key bindings

+

Key bindings

The IDLE insertion cursor is a thin vertical bar between character positions. When characters are entered, the insertion cursor and everything to its right moves right one character and @@ -554,7 +333,7 @@ the new character is entered in the new space.

delete characters. Deletion does not puts text on the clipboard, but IDLE has an undo list. Wherever this doc discusses keys, ‘C’ refers to the Control key on Windows and -Unix and the Command key on macOS. (And all such dicussions +Unix and the Command key on macOS. (And all such discussions assume that the keys have not been re-bound to something else.)

  • Arrow keys move the cursor one character or line.

  • @@ -562,8 +341,8 @@ assume that the keys have not been re-bound to something else.)

  • 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 or -next character.

  • +
  • 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.

@@ -571,7 +350,7 @@ next character.

may work. Keybindings are selected in the Configure IDLE dialog.

-

Automatic indentation

+

Automatic indentation

After a block-opening statement, the next line is indented by 4 spaces (in the Python Shell window by one tab). After certain keywords (break, return etc.) the next line is dedented. In leading indentation, Backspace deletes up @@ -582,14 +361,14 @@ are restricted to four spaces due to Tcl/Tk limitations.

Format menu.

-

Search and Replace

+

Search and Replace

Any selection becomes a search target. However, only selections within a line work because searches are only performed within lines with the terminal newline removed. If [x] Regular expression is checked, the target is interpreted according to the Python re module.

-

Completions

+

Completions

Completions are supplied, when requested and available, for module names, attributes of classes or functions, or filenames. Each request method displays a completion box with existing names. (See tab @@ -633,7 +412,7 @@ modules, not included in ‘__all__’. The hidden names can be accessed by typing ‘_’ after ‘.’, either before or after the box is opened.

-

Calltips

+

Calltips

A calltip is shown automatically when one types ( after the name of an accessible function. A function name expression may include dots and subscripts. A calltip remains until it is clicked, the cursor @@ -659,7 +438,7 @@ One might want to run a file after writing import statements, after adding function definitions, or after opening an existing file.

-

Code Context

+

Code Context

Within an editor window containing Python code, code context can be toggled in order to show or hide a pane at the top of the window. When shown, this pane freezes the opening lines for block code, such as those beginning with @@ -674,7 +453,7 @@ line to the top of the editor.

the Highlights tab in the Configure IDLE dialog.

-

Shell window

+

Shell window

In IDLE’s Shell, enter, edit, and recall complete statements. (Most consoles and terminals only work with a single physical line at a time).

Submit a single-line statement for execution by hitting Return @@ -694,7 +473,7 @@ 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 attemps to interrupt statement execution (but may fail).

  • +
  • 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 @@ -704,7 +483,7 @@ appends the latter to anything already typed at the prompt.

-

Text colors

+

Text colors

Idle defaults to black on white text, but colors text with special meanings. For the shell, these are shell output, shell error, user output, and user error. For Python code, at the shell prompt or in an editor, these are @@ -723,7 +502,7 @@ text in popups and dialogs is not user-configurable.

-

Startup and Code Execution

+

Startup and Code Execution

Upon startup with the -s option, IDLE will execute the file referenced by the environment variables IDLESTARTUP or PYTHONSTARTUP. IDLE first checks for IDLESTARTUP; if IDLESTARTUP is present the file @@ -737,7 +516,7 @@ looked for in the user’s home directory. Statements in this file will be executed in the Tk namespace, so this file is not useful for importing functions to be used from IDLE’s Python shell.

-

Command line usage

+

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
@@ -762,7 +541,7 @@ set in the Options dialog.