argparser.py 文件源码

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

项目:gixy 作者: yandex 项目源码 文件源码
def serialize(self, items):
        """Does the inverse of config parsing by taking parsed values and
        converting them back to a string representing config file contents.
        """
        r = StringIO()
        for key, value in items.items():
            if type(value) == OrderedDict:
                r.write('\n[%s]\n' % key)
                r.write(self.serialize(value))
            else:
                value, help = value
                if help:
                    r.write('; %s\n' % help)
                r.write('%s = %s\n' % (key, value))
        return r.getvalue()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号