Update the python code