API

procrunner.run(command, timeout=None, debug=False, stdin=None, print_stdout=True, print_stderr=True, callback_stdout=None, callback_stderr=None, environment=None, environment_override=None, win32resolve=True)[source]

Run an external process.

Parameters:
  • command (array) – Command line to be run, specified as array.
  • timeout – Terminate program execution after this many seconds.
  • debug (boolean) – Enable further debug messages.
  • stdin – Optional string that is passed to command stdin.
  • print_stdout (boolean) – Pass stdout through to sys.stdout.
  • print_stderr (boolean) – Pass stderr through to sys.stderr.
  • callback_stdout – Optional function which is called for each stdout line.
  • callback_stderr – Optional function which is called for each stderr line.
  • environment (dict) – The full execution environment for the command.
  • environment_override (dict) – Change environment variables from the current values for command execution.
  • win32resolve – If on Windows, find the appropriate executable first. This allows running of .bat, .cmd, etc. files without explicitly specifying their extension.
Returns:

A dictionary containing stdout, stderr, runtime, exitcode, and more.

procrunner.run_process(*args, **kwargs)[source]

API used up to version 0.2.0.

procrunner.run_process_dummy(command, **kwargs)[source]

A stand-in function that returns a valid result dictionary indicating a successful execution. The external process is not run.