os.WIFSTOPPED()
in Python is used to check if a process has stopped. This method accepts the process status code returned by os.wait()
, os.system ()
or os.waitpid()
as a parameter and returns True if the process was stopped , otherwise it returns False.
Syntax: os.WIFSTOPPED (status)
Parameter:
status: This parameter takes process status code (an integer value) as returned by os.system (), os.wait () or os.waitpid () method.Return type: This method returns a boolean value of class ’bool’. This method returns True if the process has been stopped, otherwise returns False.
Code: using the os.WIFSTOPPED ( )
|
Exit :
In Child process Process ID: 10224 Hello! Geeks In parent process Has child process been stopped ? True
Links: https://docs.python.org/3/library/os.html#os.WIFSTOPPED