ytsingleton

Prevent your script from running in parallel.


License
MIT
Install
pip install ytsingleton==0.1

Documentation

ytsingleton

If you want to prevent your script from running in parallel just instantiate SingleInstance() class.

Installation

pip install ytsingleton

Usage

from ytsingleton import SingleInstance 
lockfile = "/tmp/<app>.lock"
instance = SingleInstance(lockfile)

will sys.exit(-1) if other instance is running