python code for proximity sensor experiment