diff options
author | Georg Brandl <georg@python.org> | 2010-10-14 06:35:53 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-14 06:35:53 (GMT) |
commit | 8f7b427b5ba9f285f3e8cd806fb2f2b12d12eedd (patch) | |
tree | c8c9dcdd207ef7e64af08ecde944442d3c98605a /Doc | |
parent | a62cbf7cce9ac3e105f587c73b41f7b70d91bb3c (diff) | |
download | cpython-8f7b427b5ba9f285f3e8cd806fb2f2b12d12eedd.zip cpython-8f7b427b5ba9f285f3e8cd806fb2f2b12d12eedd.tar.gz cpython-8f7b427b5ba9f285f3e8cd806fb2f2b12d12eedd.tar.bz2 |
#7642: update to os.system() docs.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.rst | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 92bd606..c8e5b96 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1925,26 +1925,25 @@ written in Python, such as a mail server's external command delivery program. Execute the command (a string) in a subshell. This is implemented by calling the Standard C function :c:func:`system`, and has the same limitations. - Changes to :data:`sys.stdin`, etc. are not reflected in the environment of the - executed command. + Changes to :data:`sys.stdin`, etc. are not reflected in the environment of + the executed command. If *command* generates any output, it will be sent to + the interpreter standard output stream. On Unix, the return value is the exit status of the process encoded in the - format specified for :func:`wait`. Note that POSIX does not specify the meaning - of the return value of the C :c:func:`system` function, so the return value of - the Python function is system-dependent. - - On Windows, the return value is that returned by the system shell after running - *command*, given by the Windows environment variable :envvar:`COMSPEC`: on - :program:`command.com` systems (Windows 95, 98 and ME) this is always ``0``; on - :program:`cmd.exe` systems (Windows NT, 2000 and XP) this is the exit status of - the command run; on systems using a non-native shell, consult your shell - documentation. - - The :mod:`subprocess` module provides more powerful facilities for spawning new - processes and retrieving their results; using that module is preferable to using - this function. See the - :ref:`subprocess-replacements` section in the :mod:`subprocess` documentation - for some helpful recipes. + format specified for :func:`wait`. Note that POSIX does not specify the + meaning of the return value of the C :c:func:`system` function, so the return + value of the Python function is system-dependent. + + On Windows, the return value is that returned by the system shell after + running *command*. The shell is given by the Windows environment variable + :envvar:`COMSPEC`: it is usually :program:`cmd.exe`, which returns the exit + status of the command run; on systems using a non-native shell, consult your + shell documentation. + + The :mod:`subprocess` module provides more powerful facilities for spawning + new processes and retrieving their results; using that module is preferable + to using this function. See the :ref:`subprocess-replacements` section in + the :mod:`subprocess` documentation for some helpful recipes. Availability: Unix, Windows. |