Skip to main content

Simple wait

Project description

simple-wait

Simple wait

tests upload to pypi pypi pypi python versions image License

Example

from datetime import datetime
from simple_wait import wait


print("Start wait")
wait(seconds=5)
print("Finish wait")

while True:
    print()
    print("Current datetime:", datetime.now())
    print()
    wait(minutes=1, seconds=30)
import traceback
from simple_wait import wait


while True:
    try:
        # Process
        ...
        
        wait(hours=8)

    except:
        print(traceback.format_exc())
        wait(minutes=15)

Installation

You can install with:

pip install simple-wait

Install or upgrade:

pip install --upgrade simple-wait

Install or update from github:

pip install git+https://github.com/gil9red/simple-wait

Description

Parameters wait function:

Name Type Default
days int 0
seconds int 0
microseconds int 0
milliseconds int 0
minutes int 0
hours int 0
weeks int 0
progress_bar Iterable[str] ("|", "/", "-", "\\")
delay_seconds float 1
log_pattern_progress str "[{progress_bar}] Time left to wait: {left}"
log_pattern_cancel str "\nWaiting canceled\n"
log_pattern_clear_line str "\r" + " " * 100 + "\r"
log TextIOWrapper sys.stdout
is_need_stop Callable[[], bool] lambda: False

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

simple-wait-1.0.8.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

simple_wait-1.0.8-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page