__init__.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:cligraphy 作者: Netflix-Skunkworks 项目源码 文件源码
def write_configuration_file(filename, conf):
    """Write a config dict to the specified file, in yaml format"""
    import shutil

    try:
        shutil.copy2(filename, '%s.back' % filename)
    except IOError:
        pass

    try:
        os.makedirs(os.path.dirname(filename))
    except OSError:
        pass

    with open(filename, 'w') as filep:
        yaml.dump(conf, filep, indent=4, default_flow_style=False, Dumper=Dumper)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号