file.py 文件源码

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

项目:BAG_framework 作者: ucb-art 项目源码 文件源码
def read_resource(package, fname):
    """Read the given resource file and return content as string.

    Parameters
    ----------
    package : string
        the package name.
    fname : string
        the resource file name.

    Returns
    -------
    content : unicode
        the content as a unicode string.
    """
    raw_content = pkg_resources.resource_string(package, fname)
    return raw_content.decode(encoding=bag_encoding, errors=bag_codec_error)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号