Skip to main content

Python Subprocess Manager

Project description

Description

A wrapper around python’s subprocess module which handles new process spawning (optionally as a daemon), specifying a timeout period, and printing/logging/accessing the process’ output in a non-blocking fashion.

Installation

pip install subprocess_manager

Usage

from subprocess_manager.run_subprocess import run_subprocess

process, execution_time = run_subprocess('/bin/bash', ['-l', '-c', 'echo "Hello World!"')
tail_process, command_starttime, command_process_stdout, command_process_stderr = run_subprocess('/bin/bash', ['-l', '-c', 'tail process.log', daemon=True, return_std=True)

See subprocess_manager/run_subprocess.py for additional arguments and details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subprocess_manager-0.1.2.tar.gz (4.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page