Skip to main content

No project description provided

Project description

lazy-main

Generalized framework for main loop function.

Installation

pip install lazy-main

How to Use

from lazy_main import LazyMain

def main(*args, **kwargs):
    print("Hello World!")

def error_handler(exception):
    print("An error occurred!", exception)

if __name__ == "__main__":
    LazyMain(
        main=main,
        error_handler=error_handler, # This is optional.
        sleep_min=3,
        sleep_max=5,
        loop_count=-1 # -1 Means it will loop infinitely.
    ).run()

You can also pass arguments to the main function.

from lazy_main import LazyMain

def main(*args, **kwargs):
    print(kwargs["hello"]) # World!

if __name__ == "__main__":
    LazyMain(
        main=main,
    ).run(
        hello="World!",
    )

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

lazy_main-0.1.3.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

lazy_main-0.1.3-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file lazy_main-0.1.3.tar.gz.

File metadata

  • Download URL: lazy_main-0.1.3.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-100-generic

File hashes

Hashes for lazy_main-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0bad55bbe88dccbad0d91f9a301238f4589dcfd38227a581580f4839235dfb49
MD5 7751d4177363be8fd112b487b11870e1
BLAKE2b-256 5f3e5f70799c12a1a63b23424ce1bad7f8e36556587334489f8d486fdf2e292a

See more details on using hashes here.

File details

Details for the file lazy_main-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: lazy_main-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-100-generic

File hashes

Hashes for lazy_main-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce43e41464ca644838036b990d4293dbd13589a7df9c19559e6d4c6f83870893
MD5 5372d1335c64237bba9e9cfcc0446af9
BLAKE2b-256 926fb482b08c79dcff3d031c2dcbb845ec5796c1041fd62d17a195fdc78b8890

See more details on using hashes here.

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