changeset: 98239:ac6ade0c5927 branch: 2.7 user: Terry Jan Reedy date: Thu Sep 24 03:09:38 2015 -0400 files: Doc/library/idle.rst Lib/idlelib/help.html description: Issue 21995: Explain some differences between IDLE and console Python. diff -r ad560409c7d6 -r ac6ade0c5927 Doc/library/idle.rst --- a/Doc/library/idle.rst Thu Sep 24 09:05:19 2015 +0200 +++ b/Doc/library/idle.rst Thu Sep 24 03:09:38 2015 -0400 @@ -16,7 +16,7 @@ * coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit -* cross-platform: works on Windows, Unix, and Mac OS X +* cross-platform: works mostly the same on Windows, Unix, and Mac OS X * Python shell window (interactive interpreter) with colorizing of code input, output, and error messages @@ -492,8 +492,8 @@ black -Startup -------- +Startup and code execution +-------------------------- Upon startup with the ``-s`` option, IDLE will execute the file referenced by the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`. @@ -538,10 +538,27 @@ ``sys.argv`` reflects the arguments passed to IDLE itself. +IDLE-console differences +^^^^^^^^^^^^^^^^^^^^^^^^ + +As much as possible, the result of executing Python code with IDLE is the +same as executing the same code in a console window. However, the different +interface and operation occasionally affects results. + +For instance, IDLE normally executes user code in a separate process from +the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the +execution process get input from and send output to the GUI process, +which keeps control of the keyboard and screen. This is normally transparent, +but code that access these object will see different attribute values. +Also, functions that directly access the keyboard and screen will not work. + +With IDLE's Shell, one enters, edits, and recalls complete statements. +Some consoles only work with a single physical line at a time. + Running without a subprocess ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -By default, Idle executes user code in a separate subprocess via a socket, +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. If firewall software complains anyway, you can ignore it. diff -r ad560409c7d6 -r ac6ade0c5927 Lib/idlelib/help.html --- a/Lib/idlelib/help.html Thu Sep 24 09:05:19 2015 +0200 +++ b/Lib/idlelib/help.html Thu Sep 24 03:09:38 2015 -0400 @@ -79,7 +79,7 @@

IDLE has the following features:

+
+

24.6.4.2. IDLE-console differences

+

As much as possible, the result of executing Python code with IDLE is the +same as executing the same code in a console window. However, the different +interface and operation occasionally affects results.

+

For instance, IDLE normally executes user code in a separate process from +the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the +execution process get input from and send output to the GUI process, +which keeps control of the keyboard and screen. This is normally transparent, +but code that access these object will see different attribute values. +Also, functions that directly access the keyboard and screen will not work.

+

With IDLE’s Shell, one enters, edits, and recalls complete statements. +Some consoles only work with a single physical line at a time.

+
-

24.6.4.2. Running without a subprocess

-

By default, Idle executes user code in a separate subprocess via a socket, +

24.6.4.3. 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. If firewall software complains anyway, you can ignore it.

@@ -604,9 +618,10 @@
  • 24.6.3. Syntax colors
  • -
  • 24.6.4. Startup