26.5. IDLE¶
+IDLE¶
Source code: Lib/idlelib/
IDLE is Python’s Integrated Development and Learning Environment.
@@ -107,7 +120,7 @@ of global and local namespaces26.5.3. 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
@@ -510,7 +523,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.
26.5.3.1. 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
@@ -535,7 +548,7 @@ set in the Options dialog.
26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says @@ -571,7 +584,7 @@ be to delete one or more of the configuration files.
starting from a console (python -m idlelib)
and see if a message appears.
26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is intended to be the same as executing the same code in a console window. However, the different interface and operation occasionally affect @@ -589,7 +602,7 @@ Some consoles only work with a single physical line at a time. IDLE uses defined for each statement.
26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@ interact with the live application. One just has to remember to
re-enable the mainloop call when running in standard Python.
26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket, which uses the internal loopback interface. This connection is not externally visible and no data is sent to or received from the Internet. @@ -635,9 +648,9 @@ with the default subprocess if at all possible.
26.5.4. Help and preferences¶
+Help and preferences¶
26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the extensive sources of help, including tutorials, available at docs.python.org. Selected URLs can be added or removed from the help menu at any time using the @@ -645,14 +658,14 @@ Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for more information.
26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be changed via Configure IDLE on the Option menu. Keys can be user defined; IDLE ships with four built-in key sets. In addition, a user can create a custom key set in the Configure IDLE dialog under the keys tab.