Python code for Raspberry Pi