|
Download task_015/solution/code/README.md from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_015/solution/code/README.md
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_015/solution/code/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_015/solution/code/README.md
957 Bytes
| # PyCron interval scheduler | |
| This closed fixture's `original_go/cron.go` contains an interval-scheduler behavior summary, not an executable Go implementation. The Python package implements that scope; it does not parse cron expressions. | |
| `CronScheduler.add_interval_job(seconds, callback)` registers a callback with a positive finite interval. Jobs begin only after `start()`, run repeatedly, and stop after `stop()`. Repeated `start()` calls are idempotent; a stopped scheduler can be started again. Register jobs before starting. `IntervalSchedule` stores a validated interval. | |
| Usage: | |
| ```python | |
| from pycron import CronScheduler | |
| scheduler = CronScheduler() | |
| scheduler.add_interval_job(0.1, lambda: print("tick")) | |
| scheduler.start() | |
| # Perform other work, then stop the scheduler. | |
| scheduler.stop() | |
| ``` | |
| Run `python example/example.py` for a complete short-running example. The implementation uses only Python's standard library and needs no network access. | |