initial python code for use with raspberry pi version