Python code to process the data coming from the controller