converted genconf to python