Replace constant generation script with python version