Skip to main content

Limits the number of running instances of a Python script

Project description

Limits the number of running instances of a Python script

pip install lockexclusive

How to use it

import sys
from time import sleep

from lockexclusive import configure_lock

# it can be used like this:
# configure_lock(maxinstances=1, message="More than one instance running",file=sys.argv[0])

# or without the file argument:
configure_lock(maxinstances=1, message="More than one instance running")

sleep(100)

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

lockexclusive-0.10.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

lockexclusive-0.10-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file lockexclusive-0.10.tar.gz.

File metadata

  • Download URL: lockexclusive-0.10.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for lockexclusive-0.10.tar.gz
Algorithm Hash digest
SHA256 c71eb7ffe48e72d95577e17baeada728fa9dbefe27cefce2a63c76e6eddfff57
MD5 d60d6fb82671ddd57052689051836df3
BLAKE2b-256 4a908e2180c3774f207c74fe7acbe9e9189e44bf4ff751cb6b822c270d9d20ee

See more details on using hashes here.

File details

Details for the file lockexclusive-0.10-py3-none-any.whl.

File metadata

  • Download URL: lockexclusive-0.10-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for lockexclusive-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc1ed2876bcb334a4b1774af9f4c0eb152ad98743ea66aaf5f42fee04351483
MD5 dc0ae3d1c767b79c789b2ab6885c2cd1
BLAKE2b-256 409750f785605316fd288a1f99371314e8e6c40d511be4caef1614306aba458f

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