Python code for RaspberryPi