简单的锁文件系统。
simple-lock的Python项目详细描述
[![许可证](https://img.shields.io/badge/license mit brightgreen.svg)(https://github.com/0h-n0/simple lock)
[![Python版本](https://img.shields.io/badge/python-3.5,3.6-blue.svg)](https://github.com/0h-n0/simple lock)
[![pypi版本](https://img.shields.io/pypi/v/simple lock.svg)(https://badge.fury.io/py/simple lock)
[![构建状态](https://travis-ci.org/0h-n0/simple-lock.svg?branch=master)(https://travis ci.org/0h-n0/simple lock)
[![codecov](https://codecov.io/gh/0h-n0/simple lock/branch/master/graph/badge.svg)(https://codecov.io/gh/0h-n0/simple lock)
[![可维护性](https://api.codeculate.com/v1/badges/9a8b4b39d3673ccb6db6/maintability)(https://codeculate.com/github/0h-n0/simple lock/maintability)
[![BCH合规](https://bettercodehub.com/edge/badge/0h-n0/simple-lock?branch=master)](https://bettercodehub.com/)
\simple lock
simple lock将锁系统作为装饰器提供,并在代码中使用语句。很容易使用。
简单锁中主要有两个decorator。首先,“simple\u lock.lock”锁定函数并创建一个锁定文件。之后,其他函数引用的锁文件无法正常执行。其次,在不创建新锁文件的情况下,“simple_lock.watch”监视作为参数之一提供的锁文件,而不创建新的锁文件。< BR> > B/>>BR/>‘壳牌< BR/> $PIP安装简单锁
‘BR/> BR/> *如何使用
BR/>α>锁定您的函数为“SimeEyLo.Load”装饰器。当函数试图创建锁文件和锁文件时,
BR/>已存在。` simple_lock.lock`decorator返回'return_value',如下代码所示。
`` test.py
10
```
a=1,b=1)
def sleep():
import time
time.sleep(10)
sleep()->;2
`````
`simple懔lock.watch`还提供类似于“simple懔lock.lock”的功能。“simple-lock.lock”和“simple-lock.watch”之间的区别在于是否创建了锁文件。
``test.py
返回值=10)
def sleep():
导入时间
时间.sleep(10)
sleep()->;10
``````
``test.py
返回值=add,
a=1,b=1)
def sleep():
导入时间
时间。睡眠(10)
sleep()->;2
`````
引用
*https://github.com/benediktschmitt/py-filelock
[![Python版本](https://img.shields.io/badge/python-3.5,3.6-blue.svg)](https://github.com/0h-n0/simple lock)
[![pypi版本](https://img.shields.io/pypi/v/simple lock.svg)(https://badge.fury.io/py/simple lock)
[![构建状态](https://travis-ci.org/0h-n0/simple-lock.svg?branch=master)(https://travis ci.org/0h-n0/simple lock)
[![codecov](https://codecov.io/gh/0h-n0/simple lock/branch/master/graph/badge.svg)(https://codecov.io/gh/0h-n0/simple lock)
[![可维护性](https://api.codeculate.com/v1/badges/9a8b4b39d3673ccb6db6/maintability)(https://codeculate.com/github/0h-n0/simple lock/maintability)
[![BCH合规](https://bettercodehub.com/edge/badge/0h-n0/simple-lock?branch=master)](https://bettercodehub.com/)
\simple lock
simple lock将锁系统作为装饰器提供,并在代码中使用语句。很容易使用。
简单锁中主要有两个decorator。首先,“simple\u lock.lock”锁定函数并创建一个锁定文件。之后,其他函数引用的锁文件无法正常执行。其次,在不创建新锁文件的情况下,“simple_lock.watch”监视作为参数之一提供的锁文件,而不创建新的锁文件。< BR> > B/>>BR/>‘壳牌< BR/> $PIP安装简单锁
‘BR/> BR/> *如何使用
BR/>α>锁定您的函数为“SimeEyLo.Load”装饰器。当函数试图创建锁文件和锁文件时,
BR/>已存在。` simple_lock.lock`decorator返回'return_value',如下代码所示。
`` test.py
10
```
a=1,b=1)
def sleep():
import time
time.sleep(10)
sleep()->;2
`````
`simple懔lock.watch`还提供类似于“simple懔lock.lock”的功能。“simple-lock.lock”和“simple-lock.watch”之间的区别在于是否创建了锁文件。
``test.py
返回值=10)
def sleep():
导入时间
时间.sleep(10)
sleep()->;10
``````
``test.py
返回值=add,
a=1,b=1)
def sleep():
导入时间
时间。睡眠(10)
sleep()->;2
`````
引用
*https://github.com/benediktschmitt/py-filelock