python version of SPI communication