Yah , we have to change the line to ..
path = os.getcwd().split('/')[1:-4]
config= "".join(map(lambda x: x +'/', path))+'glastopf.cfg.dist'