Skip to main content

Python-based timer component for developers

Project description

thym PyPI version

A simple timer component that allows you to trigger an event at a specified interval.

Installation

There are two ways to install thym:

Install thym from PyPI (recommended):

sudo pip install thym

If you are using a virtualenv, you may want to avoid using sudo:

pip install thym

Alternatively: install thym from the GitHub source:

First, clone thym using git:

git clone https://github.com/apgeorg/thym.git

Then, cd to the thym folder and run the install command:

cd thym
sudo python setup.py install

Getting started

Timer

import thym

# Timer callback function
def timer_timeout():
  print("Hello!")

# Create a Timer which runs periodically 
t = thym.Timer(1, timer_timeout, oneshot=False)

# Start running
t.start()

You can now stop the timer:

t.stop()

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

thym-0.0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

thym-0.0.1-py3-none-any.whl (3.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