Skip to main content

a library to detect if a program is already running

Project description

Knowing if a program is already running can be useful in many situations. For example

  • avoid running operations that do not expect to be executed twice or more simultaneously

  • improve the usability of a software so that the user does not end up having multiple instances of the same program open at once.

All of this in a cross-platform python library .

The library is trivial to use:

import runstatus

if runstatus.already_running('myAppName'):
    print('do something, e.g. exiting')
    exit(0)

The library comes with various functions:

  • already_running(codeName) tells you if this same program is running in a different process

  • get_system_start_time() will give you the time when the computer was turned on in unixtime

  • process_exists(pid) will tell you if a process with that id is running

  • process_kill(pid) will kill the process with that id if exists

Install

Either use

pip install runstatus

or download the sources and run

python setup.py install

No dependencies are required. Run on python 2.7 or 3.x

Download

The git repository is available at https://github.com/riquito/runstatus

OS supported

Currently works on Linux, BSD, Windows, Mac OS

Website

http://www.sideralis.org

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

runstatus-1.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file runstatus-1.0.tar.gz.

File metadata

  • Download URL: runstatus-1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for runstatus-1.0.tar.gz
Algorithm Hash digest
SHA256 e190208683dfa6ef8964e847ead7db3ca203dc17fc09ebfb95544b278d0f082f
MD5 9d0f3ff2ff68dd4eb3d20d9a65438961
BLAKE2b-256 99d763971cbc365423f4c28b309c00d1b02451a168d6f37ddb8d2a1a5222dbb8

See more details on using hashes here.

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