shell.py 文件源码

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

项目:git-reviewers 作者: johnnadratowski 项目源码 文件源码
def write_json(output, end='', raw=False, file=None, flush=False):
    file = file or sys.stdout

    if len(output) == 1:
        output = output[0]

    if raw:
        json.dump(output, file, separators=(',', ':'), cls=JSONEncoder)
    else:
        json.dump(output, file, indent=4, sort_keys=True, cls=JSONEncoder)

    if flush:
        file.flush()

    if end:
        write_output(file, '', end=end, sep='', flush=flush)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号