I have a process id in Python. I know I can kill him with os.kill (), but how do I check if he is alive? Is there a built-in function or do I need to go into a shell?
Use the subprocessmodule to start the process. There is a function proc.poll () - it returns Noneif the process is still alive, otherwise it returns a return code for the process.
subprocess
None
http://docs.python.org/library/subprocess.html
os.kill does not kill processes, it sends them signals (it is poorly named).
os.kill
0, , . , .
. man 2 kill.
man 2 kill
, , SIGCHLD, , wait, .
SIGCHLD
wait
Source: https://habr.com/ru/post/1712386/More articles:Установка выражения watch в Firebug: ReferenceError - s не определено - javascriptIs this a physics game? - mathUndefined symbol error for base class in C ++ shared library - c ++Frame rate in windowed mode and frame rate in fullscreen mode - performanceHow can I think of math in programming? - mathReconstructing Generic Types at Run Time with Guice through Types and TypeLiterals - genericsUsing generics for arrays - javaJava GUI design consultation - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712390/update-desktop-show-window-contents-while-dragging-setting-programatically&usg=ALkJrhj5bq244J1mETnn-nt_VqnCj2nurAРеализация программного обеспечения - выпуск/модуль/ошибка/отслеживание функций - designAll Articles