subprocess.Popen.returncode

Popen.returncode The child return code, set by poll() and wait() (and indirectly by communicate()). A None value indicates that the process hasn’t terminated yet. A negative value -N indicates that the child was terminated by signal N (POSIX only).

subprocess.Popen.poll()

Popen.poll() Check if child process has terminated. Set and return returncode attribute.

subprocess.Popen.send_signal()

Popen.send_signal(signal) Sends the signal signal to the child. Note On Windows, SIGTERM is an alias for terminate(). CTRL_C_EVENT and CTRL_BREAK_EVENT can be sent to processes started with a creationflags parameter which includes CREATE_NEW_PROCESS_GROUP.

subprocess.Popen.stderr

Popen.stderr If the stderr argument was PIPE, this attribute is a readable stream object as returned by open(). Reading from the stream provides error output from the child process. If the universal_newlines argument was True, the stream is a text stream, otherwise it is a byte stream. If the stderr argument was not PIPE, this attribute is None.

subprocess.Popen.kill()

Popen.kill() Kills the child. On Posix OSs the function sends SIGKILL to the child. On Windows kill() is an alias for terminate().

subprocess.Popen.communicate()

Popen.communicate(input=None, timeout=None) Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be data to be sent to the child process, or None, if no data should be sent to the child. The type of input must be bytes or, if universal_newlines was True, a string. communicate() returns a tuple (stdout_data, stderr_data). The data will be bytes or, if universal_newlines was

subprocess.Popen

class subprocess.Popen(args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=()) Execute a child program in a new process. On POSIX, the class uses os.execvp()-like behavior to execute the child program. On Windows, the class uses the Windows CreateProcess() function. The arguments to Popen ar

subprocess.Popen.pid

Popen.pid The process ID of the child process. Note that if you set the shell argument to True, this is the process ID of the spawned shell.

subprocess.Popen.args

Popen.args The args argument as it was passed to Popen – a sequence of program arguments or else a single string. New in version 3.3.

subprocess.CompletedProcess.returncode

returncode Exit status of the child process. Typically, an exit status of 0 indicates that it ran successfully. A negative value -N indicates that the child was terminated by signal N (POSIX only).