Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b5d9e081
Kaydet (Commit)
b5d9e081
authored
Kas 08, 2017
tarafından
James
Kaydeden (comit)
Victor Stinner
Kas 08, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31884 subprocess: add Windows constants for process priority (#4150)
üst
54cc0c07
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
6 deletions
+119
-6
subprocess.rst
Doc/library/subprocess.rst
+94
-4
subprocess.py
Lib/subprocess.py
+12
-2
2017-10-27.bpo-31884.bjhre9.rst
Misc/NEWS.d/next/Library/2017-10-27.bpo-31884.bjhre9.rst
+1
-0
_winapi.c
Modules/_winapi.c
+12
-0
No files found.
Doc/library/subprocess.rst
Dosyayı görüntüle @
b5d9e081
...
...
@@ -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
...
...
Lib/subprocess.py
Dosyayı görüntüle @
b5d9e081
...
...
@@ -164,13 +164,23 @@ if _mswindows:
from
_winapi
import
(
CREATE_NEW_CONSOLE
,
CREATE_NEW_PROCESS_GROUP
,
STD_INPUT_HANDLE
,
STD_OUTPUT_HANDLE
,
STD_ERROR_HANDLE
,
SW_HIDE
,
STARTF_USESTDHANDLES
,
STARTF_USESHOWWINDOW
)
STARTF_USESTDHANDLES
,
STARTF_USESHOWWINDOW
,
ABOVE_NORMAL_PRIORITY_CLASS
,
BELOW_NORMAL_PRIORITY_CLASS
,
HIGH_PRIORITY_CLASS
,
IDLE_PRIORITY_CLASS
,
NORMAL_PRIORITY_CLASS
,
REALTIME_PRIORITY_CLASS
,
CREATE_NO_WINDOW
,
DETACHED_PROCESS
,
CREATE_DEFAULT_ERROR_MODE
,
CREATE_BREAKAWAY_FROM_JOB
)
__all__
.
extend
([
"CREATE_NEW_CONSOLE"
,
"CREATE_NEW_PROCESS_GROUP"
,
"STD_INPUT_HANDLE"
,
"STD_OUTPUT_HANDLE"
,
"STD_ERROR_HANDLE"
,
"SW_HIDE"
,
"STARTF_USESTDHANDLES"
,
"STARTF_USESHOWWINDOW"
,
"STARTUPINFO"
])
"STARTUPINFO"
,
"ABOVE_NORMAL_PRIORITY_CLASS"
,
"BELOW_NORMAL_PRIORITY_CLASS"
,
"HIGH_PRIORITY_CLASS"
,
"IDLE_PRIORITY_CLASS"
,
"NORMAL_PRIORITY_CLASS"
,
"REALTIME_PRIORITY_CLASS"
,
"CREATE_NO_WINDOW"
,
"DETACHED_PROCESS"
,
"CREATE_DEFAULT_ERROR_MODE"
,
"CREATE_BREAKAWAY_FROM_JOB"
])
class
Handle
(
int
):
closed
=
False
...
...
Misc/NEWS.d/next/Library/2017-10-27.bpo-31884.bjhre9.rst
0 → 100644
Dosyayı görüntüle @
b5d9e081
added required constants to subprocess module for setting priotity on windows
Modules/_winapi.c
Dosyayı görüntüle @
b5d9e081
...
...
@@ -1595,6 +1595,18 @@ PyInit__winapi(void)
WINAPI_CONSTANT
(
F_DWORD
,
WAIT_OBJECT_0
);
WINAPI_CONSTANT
(
F_DWORD
,
WAIT_ABANDONED_0
);
WINAPI_CONSTANT
(
F_DWORD
,
WAIT_TIMEOUT
);
WINAPI_CONSTANT
(
F_DWORD
,
ABOVE_NORMAL_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
BELOW_NORMAL_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
HIGH_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
IDLE_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
NORMAL_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
REALTIME_PRIORITY_CLASS
);
WINAPI_CONSTANT
(
F_DWORD
,
CREATE_NO_WINDOW
);
WINAPI_CONSTANT
(
F_DWORD
,
DETACHED_PROCESS
);
WINAPI_CONSTANT
(
F_DWORD
,
CREATE_DEFAULT_ERROR_MODE
);
WINAPI_CONSTANT
(
F_DWORD
,
CREATE_BREAKAWAY_FROM_JOB
);
WINAPI_CONSTANT
(
"i"
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment