filelock ,it can run on linux and windows
Project description
1. pip install nb_filelock
基于代码所在机器的跨进程 跨(jvm)解释器的文件互斥锁。
兼容windwos和linux
比如希望在当前机器只能同时运行某一个代码块,完全豪不相关的两次启动xx.py,没有办法使用进程锁,
压根就不是使用multiprossing包同时启动的多个子进程而是手动两次运行了python xx.py,
好的方式是使用redis分布式锁,可以保证所有机器只提示一个获得锁,但如果没安装redis切要保证当前机器只有一个能执行代码块,
则使用此锁
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
nb_filelock-0.1.tar.gz
(2.5 kB
view hashes)