edit to python code