CHAPTER 3
Contents:
3.1 Installation
Installing pickups is easy. Just use pip:
$ pip install pickups
Common practise is to have an own virtual environment for your new project. Having virtualenvwrapper
installed, you can install pickups with:
$ mkvirtualenv pickups
$ pip install pickups
3.2 Usage
To use pickups in a project you have to import the main package by invoking:
$ import pickups
3.2.1 Get Started
For your convenience you can use the helper method pickups.helpers.register() which creates a custom
signal handler for you and then starts looping (depending on your configuration file) to infinity to update the extreme
feedback device statuses. Using the already shipped pickups.bamboo.BambooPickup and a configuration file
you can easily start going with a very simple runner like this:
import os
import signal
import pickups
from pickups.bamboo.bamboopickup import BambooPickup
def registerpickup(configfile):
pickups.helpers.register(BambooPickup, configfile, sign=signal.SIGTERM)
def main():
here = os.path.abspath(os.path.dirname(__file__))
configfile = os.path.join(here, ’config.cfg’)
7
Commentaires sur ces manuels