Shaare your links...
3379 links
L!NKS Retour au blog Login RSS Feed ATOM Feed Tag cloud Picture wall Daily
Links per page: 20 50 100
◄Older
page 4 / 10
Newer►
194 results for tags python x
  • Manipuler les dates et les durées en Python | Sam & Max
    Bon marre de rechercher sans arrêt : google sametmax datetime...
    alors je le mets ici !

    et aussi :
    http://sametmax.com/serialiser-et-parser-une-date-en-python-formats-de-strftimestrptime-et-timestamps/
    permalink -
    - http://sametmax.com/manipuler-les-dates-et-les-durees-en-python/
    memo python
  • Utiliser requests de manière non bloquante facilement | Sam & Max
    permalink -
    - http://sametmax.com/utiliser-requests-de-maniere-non-bloquante-facilement/
    python requests
  • Save a file using the python requests library - Stack Overflow
    ########################
    with open('output.jpg', 'wb') as handle:
       response = requests.get('http://www.example.com/image.jpg', stream=True)

       if not response.ok:
           # Something went wrong

       for block in response.iter_content(1024):
           if not block:
               break
           handle.write(block)
    ########################
    /*I usually just use urllib.urlretrieve(). It works, but if you need to use a session or some sort of authentication, the above code works as well.*/

    voir aussi : https://stackoverflow.com/questions/13137817/how-to-download-image-using-requests
    -----------------------------------------------------------------------------------------------------------------------------------------


    Get a file-like object from the request and copy it to a file. This will also avoid reading the whole thing into memory at once.
    ########################
    import shutil
    import requests

    url = 'http://example.com/img.png'
    response = requests.get(url, stream=True)
    with open('img.png', 'wb') as out_file:
       shutil.copyfileobj(response.raw, out_file)
    del response
    ########################

    Note that the .raw file-like object does not decompress a response using Content-Encoding: gzip or Content-Encoding: deflate. You can use response.raw.read(decode_content=True) but shutil.copyfileobj cannot do that because it assumes a generic .read() method

    ########################
    import requests
    import shutil

    r = requests.get(settings.STATICMAP_URL.format(**data), stream=True)
    if r.status_code == 200:
       with open(path, 'wb') as f:
           r.raw.decode_content = True
           shutil.copyfileobj(r.raw, f)
    ########################
    ou :
    #######################
    r = requests.get(settings.STATICMAP_URL.format(**data), stream=True)
    if r.status_code == 200:
       with open(path, 'wb') as f:
           for chunk in r.iter_content(1024):
               f.write(chunk)
    ########################
    permalink -
    - https://stackoverflow.com/questions/14114729/save-a-file-using-the-python-requests-library
    python
  • Quickstart — Flask Documentation (0.10)
    permalink -
    - http://flask.pocoo.org/docs/0.10/quickstart/#sessions
    flask python webserver
  • Picamera pour piloter intégralement la caméra de votre Raspberry Pi en Python | Framboise 314, le Raspberry Pi à la sauce française….
    permalink -
    - http://www.framboise314.fr/picamera-pour-piloter-integralement-la-camera-de-votre-raspberry-pi-en-python/
    camera python raspberry
  • Tiny-Python-Snapshot-Server
    Petit script python pour prendre régulièrement une photo avec une camera pour raspberry et la diffuser sur une serveur web
    permalink -
    - https://github.com/modmypi/Tiny-Python-Snapshot-Server/blob/master/snapshot.py
    photo python raspberry script
  • rfxcom 0.3.0 : Python Package Index
    permalink -
    - https://pypi.python.org/pypi/rfxcom/0.3.0
    python RFXCOM
  • Librairie python pour communiquer avec RFXtrx (RFXCOM)
    permalink -
    - https://github.com/woudt/pyRFXtrx
    433Mhz python RFXCOM
  • rfxcmd - Command line utility for RFX devices - Google Project Hosting
    permalink -
    - https://code.google.com/p/rfxcmd/
    python RFXCOM
  • Python 3 Wall of Superpowers
    permalink -
    - https://python3wos.appspot.com/
    python
  • Kivy/python-for-android: Slides
    Présentation rapide de kivy (développement d'application pour mobile android, IOS,..) en python
    permalink -
    - http://slides.com/baptistelagarde/kivy-python-for-android/fullscreen#/12
    android kivy python
  • Dusty's Diverse Domain » Blog Archive » Building a Python Kivy App in Android (Easier than it looks, but harder than it needs to be)
    permalink -
    - http://archlinux.me/dusty/2012/12/05/building-a-python-kivy-app-in-android-easier-than-it-looks-but-harder-than-it-needs-to-be/
    android kivy python
  • Qu’est-ce qu’une coroutine en Python, et à quoi ça sert ? | Sam & Max
    En résumé :

       yield permet de faire des générateurs
       On peut demander la prochaine valeur du générateur avec next(). Dans ce cas, le code s’exécute jusqu’au prochain yield.
       On peut envoyer une valeur au générateur avec send(). Dans ce cas, on DOIT partir d’un yield existant duquel on récupère la valeur envoyée via une assignation. Donc il faut au moins un next() avant d’utiliser un send() et un signe égal sur le yield.
       send() va aussi aller au prochain yield et retourner sa valeur.
       Une coroutine n’est qu’une formalisation de la manière d’éffectuer une tâche avec un init, une exécution et une finalisation optionelle en utilisant un générateur. C’est une solution générique à un problème courant, mais plus léger qu’une classe.
       Généralement on décore les générateurs coroutines avec un décorateur @coroutine pour s’éviter d’appeler next() à la main et notifier l’usage qu’il est fait de ce générateur.
       On peut chaîner des coroutines comme on chaîne des générateurs, mais au lieu de lire les données une à une (PULL), on les envoie une par une (PUSH). Cela est pratique quand on ne sait pas à l’avance quand une nouvelle donnée va arriver.
    permalink -
    - http://sametmax.com/quest-ce-quune-coroutine-en-python-et-a-quoi-ca-sert/
    python
  • pyspider - Liens en vrac de sebsauvage
    permalink -
    - http://sebsauvage.net/links/?AIhfhQ
    crawler python
  • AES encryption of files in Python with PyCrypto - Eli Bendersky's website
    permalink -
    - http://eli.thegreenplace.net/2010/06/25/aes-encryption-of-files-in-python-with-pycrypto/
    crypt pycrypto python
  • Un framework Web python dans une bouteille
    permalink -
    - http://sebastien-dupire.info/python-bottle-framework.html
    bottle python
  • Tutorial — Bottle 0.13-dev documentation
    static_files (css, images,...)
    from bottle import static_file
    @route('/images/<filename:re:.*\.png>')
    def send_image(filename):
       return static_file(filename, root='/path/to/image/files', mimetype='image/png')

    @route('/static/<filename:path>')
    def send_static(filename):
       return static_file(filename, root='/path/to/static/files')
    permalink -
    - http://bottlepy.org/docs/dev/tutorial.html#static-files
    bottle python
  • Utiliser Cherrypy (serveur web léger) avec Bottle (Framework léger) | Sam & Max
    permalink -
    - http://sametmax.com/utiliser-cherrypy-serveur-web-leger-avec-bottle-framework-leger/
    bottle cherrypy python
  • Tutoriel Matplotlib
    permalink -
    - http://python.developpez.com/tutoriels/graphique-2d/matplotlib/#LII-I
    matplotlib python tuto
  • Python Headless MatplotLib / Pyplot - Stack Overflow
    import matplotlib
    matplotlib.use('Agg')
    permalink -
    - https://stackoverflow.com/questions/5503601/python-headless-matplotlib-pyplot
    matplotlib python
Links per page: 20 50 100
◄Older
page 4 / 10
Newer►
Shaarli 0.0.41 beta - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.