Covert to python