diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-24 07:09:43 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-24 07:09:43 (GMT) |
commit | 0053c47785fc86d261f9d40cd11d943dd96d1a3d (patch) | |
tree | eb66667d46fc28f6f873a279d2897a7e4ee36a31 /Doc | |
parent | bfd9767e0ff878704eed8672dddb970f12abe9c7 (diff) | |
download | cpython-0053c47785fc86d261f9d40cd11d943dd96d1a3d.zip cpython-0053c47785fc86d261f9d40cd11d943dd96d1a3d.tar.gz cpython-0053c47785fc86d261f9d40cd11d943dd96d1a3d.tar.bz2 |
Issue 21995: Explain some differences between IDLE and console Python.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/idle.rst | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index c149aa9..fe8e89e 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -16,7 +16,7 @@ IDLE has the following features: * 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 @@ Shell colors: 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 @@ If there are arguments: ``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. |