This page is an archive of iMAL's wiki that operated between 2012 and 2022. It documented projects, residencies and workshops mostly taking place at iMAL's Fablab.

Older & newer Fablab projects are now found at

Objets connectés / Raspbery Pi + Python

Notes et commentaires concernant l'atelier Objets connectés / Raspbery Pi + Python.

Tous les scripts sont disponibles dans le dépôt créé pour le cours:

(adaptation du du dépôt)



  • : basic file server (start it in the html folder with python ../ to make visible the base root stuff)

GET requests

  • : parsing GET requests, and responding to the browser
  • : changing returned message depending on the get parameters
  • : adapting header to send images, big piece of code, go smoothly!
  • : script developped during the workshop

POST requests

  • : parsing POST requests and saving files on drive
  • : listing files uploaded & providing links to files
  • : script developped during the workshop


  • : simple example on how to extract content from a webpage

requires the installation of python-bs4, on linux:

sudo apt install python-bs4
  • : advanced example using selenium's webdriver


works on linux desktop 64 bits, for raspberry, see below

sudo apt install python-bs4
sudo apt-get install libxss1 libappindicator1 libindicator7
sudo dpkg -i google-chrome*.deb
sudo apt-get install -f
sudo apt-get install xvfb
sudo apt-get install unzip
wget -N
chmod +x chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
sudo -H python3 -m pip install pyvirtualdisplay selenium

on raspberry:


test your installation with the script

  • : get all tweets from a user, depending on twitter definition of 'all'
  • : another script to get tweets form a specific user


  • twitter/ script developped by Amélie Dumont retrieving tweets by hashtag


Flask is an advanced webserver, compare to SimpleHTTPServer used in the scripts above.

The folder app_flask contains a project of Amélie Dumont that controls the rotation of a servo motor via a web interface.


  • : demo on how to serialise and deserialise python data using json


Open Sound Control demo in python, allows to send and receive data using UDP protocol.

  • : how to send OSC messages
  • : how to receive OSC messages
  • : quick and dirty way to send messages to all computers in LAN


Multithreading designates the fact that several application runs simultaneously in a computer. The lastest Raspberry PI having a multicore CPU, threading allows to run several applications/scripts at the same time, without waiting for a process to complete to starts another one. This is an important topics to master when creating games, robots, or any other demanding application running in realtime, reacting to inputs or parsing live feeds.

  • : shows how to run several 'applications' within one script


to launch programs with python, use, see documentation for more details

  • : play a video in fullscreen with vlc


Pillow is a library to manipulate images in python.

  • : shows basic PIL functionalities


OpenCV is a powerful image processing library, massively used in computer vision. It is trickier to understand then PIL because it is based on matrix transformations.

  • : detection of motions in live video (webcam in this case)
  • : adaptation of the script for picam, with desactivation of white balance and OSC emission of the anaylis.


PyGame is a library containing all the required features to create games in python.

  • pygam/ : basic script to run a game with keyboard interactions
  • pygam/ : a simple particles system interacting with the mouse (2D)
  • pygam/ : 3D adaptation of the particles, using OpenGL
  • pygam/ : OpenGL demo using pygame by Bastiaan Zapf

note: tous les scripts développés par frankiezafe & Amélie sont diffusés sous license GNU LGPLv3



Animated by:

Date: 30 Jul 2019 - 2 Aug 2019