summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorJames <james_g_k@hotmail.co.uk>2017-11-08 14:18:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-11-08 14:18:59 (GMT)
commitb5d9e0811463f3b28ba355a9e0bee7f1682854e3 (patch)
tree7e69240929fc485f37e70c5d5336d7d873755ed5 /Doc
parent54cc0c0789af8ff2396cb19095b7ab269f2bc06c (diff)
downloadcpython-b5d9e0811463f3b28ba355a9e0bee7f1682854e3.zip
cpython-b5d9e0811463f3b28ba355a9e0bee7f1682854e3.tar.gz
cpython-b5d9e0811463f3b28ba355a9e0bee7f1682854e3.tar.bz2
bpo-31884 subprocess: add Windows constants for process priority (#4150)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/subprocess.rst98
1 files changed, 94 insertions, 4 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 693355c..a2c184a 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -516,8 +516,20 @@ functions.
If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is
passed to the underlying ``CreateProcess`` function.
- *creationflags*, if given, can be :data:`CREATE_NEW_CONSOLE` or
- :data:`CREATE_NEW_PROCESS_GROUP`. (Windows only)
+ *creationflags*, if given, can be one or more of the following flags:
+
+ * :data:`CREATE_NEW_CONSOLE`
+ * :data:`CREATE_NEW_PROCESS_GROUP`
+ * :data:`ABOVE_NORMAL_PRIORITY_CLASS`
+ * :data:`BELOW_NORMAL_PRIORITY_CLASS`
+ * :data:`HIGH_PRIORITY_CLASS`
+ * :data:`IDLE_PRIORITY_CLASS`
+ * :data:`NORMAL_PRIORITY_CLASS`
+ * :data:`REALTIME_PRIORITY_CLASS`
+ * :data:`CREATE_NO_WINDOW`
+ * :data:`DETACHED_PROCESS`
+ * :data:`CREATE_DEFAULT_ERROR_MODE`
+ * :data:`CREATE_BREAKAWAY_FROM_JOB`
Popen objects are supported as context managers via the :keyword:`with` statement:
on exit, standard file descriptors are closed, and the process is waited for.
@@ -803,8 +815,8 @@ on Windows.
:class:`Popen` is called with ``shell=True``.
-Constants
-^^^^^^^^^
+Windows Constants
+^^^^^^^^^^^^^^^^^
The :mod:`subprocess` module exposes the following constants.
@@ -851,6 +863,84 @@ The :mod:`subprocess` module exposes the following constants.
This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified.
+.. data:: ABOVE_NORMAL_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have an above average priority.
+
+ .. versionadded:: 3.7
+
+.. data:: BELOW_NORMAL_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have a below average priority.
+
+ .. versionadded:: 3.7
+
+.. data:: HIGH_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have a high priority.
+
+ .. versionadded:: 3.7
+
+.. data:: IDLE_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have an idle (lowest) priority.
+
+ .. versionadded:: 3.7
+
+.. data:: NORMAL_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have an normal priority. (default)
+
+ .. versionadded:: 3.7
+
+.. data:: REALTIME_PRIORITY_CLASS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will have realtime priority.
+ You should almost never use REALTIME_PRIORITY_CLASS, because this interrupts
+ system threads that manage mouse input, keyboard input, and background disk
+ flushing. This class can be appropriate for applications that "talk" directly
+ to hardware or that perform brief tasks that should have limited interruptions.
+
+ .. versionadded:: 3.7
+
+.. data:: CREATE_NO_WINDOW
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will not create a window
+
+ .. versionadded:: 3.7
+
+.. data:: DETACHED_PROCESS
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ will not inherit its parent's console.
+ This value cannot be used with CREATE_NEW_CONSOLE.
+
+ .. versionadded:: 3.7
+
+.. data:: CREATE_DEFAULT_ERROR_MODE
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ does not inherit the error mode of the calling process. Instead, the new
+ process gets the default error mode.
+ This feature is particularly useful for multithreaded shell applications
+ that run with hard errors disabled.
+
+ .. versionadded:: 3.7
+
+.. data:: CREATE_BREAKAWAY_FROM_JOB
+
+ A :class:`Popen` ``creationflags`` parameter to specify that a new process
+ is not associated with the job.
+
+ .. versionadded:: 3.7
+
.. _call-function-trio:
Older high-level API