Convert C source to Python