Energenie EG-PMS Manuel d'utilisateur Page 11

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 30
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 10
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
Vue de la page 10
1 2 ... 6 7 8 9 10 11 12 13 14 15 16 ... 29 30

Commentaires sur ces manuels

Pas de commentaire