resp.py 文件源码

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

项目:pyrsss 作者: butala 项目源码 文件源码
def parse_block_header(fid):
    """
    Parse the block header found in *fid*. Return a mapping containing
    the header information.
    """
    block_header = {}
    for line in fid:
        if line.startswith('#'):
            break
        toks = line.split()
        key = '_'.join(toks[1:-1])[:-1]
        value = toks[-1]
        if key.endswith('date'):
            value = datetime.strptime(value, '%Y,%j,%H:%M:%S')
        block_header[key] = value
    return block_header
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号