python-timeout-6.2
توضیحات
Random timeout between minimum and maximum values
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | python-timeout-6.2 |
| نام | python-timeout |
| نسخه کتابخانه | 6.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/xjxckk/python-timeout/ |
| آدرس اینترنتی | https://pypi.org/project/python-timeout/ |
| مجوز | - |
### Timeout
Random timeout between minimum and maximum values
Installation:
`pip install python-timeout`
Usage:
```
from timeout import random_timeout, sleep
random_timeout(10, 20) # Random timeout between 10 and 20 seconds
random_timeout(from_minutes=1, to_minutes=2) # Random timeout between one and two minutes
random_timeout(from_hours=1, to_hours=2) # Random timeout between one and two hours
random_timeout(from_days=3, to_days=7) # Random timeout between one and two hours
random_timeout(1) # Random timeout for around one second
random_timeout(from_hours=1) # Random timeout for around one hour
sleep(5) # Sleep for five seconds
sleep(minutes=15) # Sleep for fifteen minutes
sleep(hours=2) # Sleep for two hours
from timeout import SleepTimer
during_active_time = SleepTimer('8am', '10pm').during_active_time
if during_active_time(): # Only active between certain time range
run()
```
نحوه نصب
نصب پکیج whl python-timeout-6.2:
pip install python-timeout-6.2.whl
نصب پکیج tar.gz python-timeout-6.2:
pip install python-timeout-6.2.tar.gz