How to achieve a single instance of Python

Source: https://stackoverflow.com/questions/380870/make-sure-only-a-single-instance-of-a-program-is-running

from tendo import singleton
me = singleton.SingleInstance() # will sys.exit(-1) if other instance is running

https://pypi.org/project/tendo/#files

Guess you like

Origin www.cnblogs.com/liujx2019/p/11294522.html