__init__.py 文件源码

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

项目:micro-blog 作者: nickChenyx 项目源码 文件源码
def detect(aBuf):
    if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or
            (version_info >= (3, 0) and not isinstance(aBuf, bytes))):
        raise ValueError('Expected a bytes object, not a unicode object')

    from . import universaldetector
    u = universaldetector.UniversalDetector()
    u.reset()
    u.feed(aBuf)
    u.close()
    return u.result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号