@@ -8,6 +8,40 @@ Simple wait
88[ ![ image] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://pypi.org/project/black/ )
99[ ![ License] ( https://img.shields.io/badge/license-MIT-black.svg )] ( https://opensource.org/licenses/MIT )
1010
11+ ## Example
12+ ``` python
13+ from datetime import datetime
14+ from simple_wait import wait
15+
16+
17+ print (" Start wait" )
18+ wait(seconds = 5 )
19+ print (" Finish wait" )
20+
21+ while True :
22+ print ()
23+ print (" Current datetime:" , datetime.now())
24+ print ()
25+ wait(minutes = 1 , seconds = 30 )
26+ ```
27+
28+ ``` python
29+ import traceback
30+ from simple_wait import wait
31+
32+
33+ while True :
34+ try :
35+ # Process
36+ ...
37+
38+ wait(hours = 8 )
39+
40+ except :
41+ print (traceback.format_exc())
42+ wait(minutes = 15 )
43+ ```
44+
1145## Installation
1246You can install with:
1347```
@@ -24,18 +58,23 @@ Install or update from github:
2458pip install git+https://github.com/gil9red/simple-wait
2559```
2660
27- ## Example:
28- ``` python
29- from datetime import datetime
30- from simple_wait import wait
61+ ## Description
3162
32- print (" Start wait" )
33- wait(seconds = 5 )
34- print (" Finish wait" )
63+ Parameters ` wait ` function:
3564
36- while True :
37- print ()
38- print (" Current datetime:" , datetime.now())
39- print ()
40- wait(minutes = 1 , seconds = 30 )
41- ```
65+ | Name | Type | Default |
66+ | ------------------------| ----------------------| ------------------------------------------------|
67+ | days | ` int ` | ` 0 ` |
68+ | seconds | ` int ` | ` 0 ` |
69+ | microseconds | ` int ` | ` 0 ` |
70+ | milliseconds | ` int ` | ` 0 ` |
71+ | minutes | ` int ` | ` 0 ` |
72+ | hours | ` int ` | ` 0 ` |
73+ | weeks | ` int ` | ` 0 ` |
74+ | progress_bar | ` Iterable[str] ` | ` ("|", "/", "-", "\\") ` |
75+ | delay_seconds | ` float ` | ` 1 ` |
76+ | log_pattern_progress | ` str ` | ` "[{progress_bar}] Time left to wait: {left}" ` |
77+ | log_pattern_cancel | ` str ` | ` "\nWaiting canceled\n" ` |
78+ | log_pattern_clear_line | ` str ` | ` "\r" + " " * 100 + "\r" ` |
79+ | log | ` TextIOWrapper ` | ` sys.stdout ` |
80+ | is_need_stop | ` Callable[[], bool] ` | ` lambda: False ` |
0 commit comments