模拟requests的timeout参数,使任意函数都拥有超时跳出的功能,防止访问超时阻塞影响代码的运行
Project description
安装
pip install with_timeout
使用示例
from with_timeout import with_timeout
@with_timeout(5)
def my_func():
pass
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
with_timeout-0.0.5.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for with_timeout-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 400a19d2fd1cd2508557872533b60f38f52d3d507105c41fe9a2f31bc016c5d1 |
|
MD5 | 90be88e46d376c2aa70823babbd5c0d8 |
|
BLAKE2b-256 | c5d4d4bfc7c9dc9baa8351216453be1c6c3c5a081264d2fc4d6e6a691d24d5ed |