Methods of Popen:
Popen.poll ()
Used to check whether the child process has ended. Sets and returns the ReturnCode property.
Popen.wait ()
Wait for the child process to end. Sets and returns the ReturnCode property.
Popen.communicate (Input=none)
Interacts with the child process. Send data to stdin, or read data from stdout and stderr. Optional parameter input Specifies the parameters that are sent to the child process. Communicate () returns a tuple: (Stdoutdata, Stderrdata). Note: If you want to send data to it through the process's stdin, the parameter stdin must be set to pipe when the Popen object is created. Similarly, if you want to get data from stdout and stderr, you must set stdout and stderr to pipe.
Popen.send_signal (signal)
Sends a signal to a child process.
Popen.terminate ()
Stop (stop) child process. Under the Windows platform, this method will call Windows API TerminateProcess () to end the child process.
Popen.kill ()
Kills a child process.
Popen.stdin
If the Popen object is created, the parameter stdin is set to Pipe,popen.stdin will return a file object for the policy child process send instruction. Otherwise, none is returned.
Popen.stdout
If the Popen object is created, the parameter stdout is set to Pipe,popen.stdout will return a file object for the policy child process send instruction. Otherwise, None is returned.
Popen.stderr
If the Popen object is created, the parameter stdout is set to Pipe,popen.stdout will return a file object for the policy child process send instruction. Otherwise, None is returned.
Popen.pid
Gets the process ID of the child process.
Popen.returncode
Gets the return value of the process. Returns none if the process is not finished yet.
Methods of Popen