change gen_p_z_w.py into module.