update python code