pymzn.process.Process

class pymzn.process.Process(args)

Wrapper for an external process.

Usable to run a synchronous process or to manage an asynchronous one.

Parameters:args ([str]) – The command line arguments to execute. Same as for subprocess.Popen (with shell=False).
returncode

int or None – The returncode of the process. While the process has not finished the returncode is None. After the process is finished, the returncode is retrieved as by Popen.poll().

stdout_data

str or bytes – The content of the standard output of the process after the execution.

stderr_data

str or bytes – The content of the standard error of the process after the execution.

expired

bool – Whether the process was terminated because the timeout expired.

interrupted

bool – Whether the process was interrupted by a KeyboardInterruption.

async

bool – Whether the process was started asynchronously.

started

bool – Whether the process has started.

alive

bool – Whether the process is still running.

completed

bool – Whether the process was completed without errors.

runtime

float – The running time in seconds. If the process is alive, it marks the running time up to now. If instead the process is terminated, it marks the running time of the process up to its end.

stdout

The underlying output stream of the process.

stderr

The underlying error stream of the process.

Methods

readlines() Generator of lines from the standard output of the process.
run([input, timeout]) Run the process synchronously.
start([stdin, timeout]) Starts the process asynchronously.
stop() Stops the process.

Attributes

alive
completed
runtime
started
stderr
stdout