Skip to main content

A wrapper for subprocess popen

Project description

OSMeterium

The osmeterium is a defensive organ found in all papilionid larvae, in all stages.

A simple wrapper for Popen to meet MapColonies org needs for running background processes and pipe the output.

Usage

Async

t = run_command_async('ping -c 5 www.google.com',
        (lambda x: print('Hey this stdout output {0}'.format(x))),
        (lambda x: print('Hey this stderr output {0}'.format(x))),
        (lambda y: print('This is exit code ${0}'.format(y))),
        (lambda: print('Command success'))) #  return a Thread Object
t.join()

Sync

run_command('ping -c 5 www.google.com',
        (lambda x: print('Hey this stdout output {0}'.format(x))),
        (lambda x: print('Hey this stderr output {0}'.format(x))),
        (lambda y: print('This is exit code ${0}'.format(y))),
        (lambda: print('Command success')))

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

osmeterium-0.0.3.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

osmeterium-0.0.3-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

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