Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Limitloop is a lightweight python module for running loops that depend on precise timing.

Project description

Limitloop

Limitloop is a lightweight python module for running loops that depend on precise timing.

This package is available through Pypi and can be installed with the following command.

python -m pip install limitloop

Basic usage

All functionality of the module is provided through the limitloop.Loop class. This class is instantiated with a reference to a function, which it can then call at a consistent rate a preset number of times, or until otherwise interrupted. For example, the following code...

from limitloop import Loop

#Define a simple function for the Loop object to call
#This function must accept the loop object itself as its first argument
def demoFunction(loop):
    print('Hello, world!')

#Create our loop object, set to run at one iteration per second
l = Loop(demoFunction, freq=1)
#Call the function defined above 5 times
l.run(5)

...will output the following, one line per second.

Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!

See the API reference for more advanced usage.

TODO: Add more advanced usage examples

Project details


Release history Release notifications

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for limitloop, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size limitloop-0.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page