__init__.py 文件源码

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

项目:correct-horse 作者: bbiw 项目源码 文件源码
def getwords(wordlists):
    """return a list of all unique words in all specified files"""
    words = []
    for wl in wordlists:
        if os.path.exists(wl):
            words.extend(slurp(wl))
            continue
        rp = 'wordlists/' + wl
        if pkg_resources.resource_exists(__name__, rp):
            words.extend(pkg_resources.resource_string(
                __name__, rp).decode('utf-8').splitlines())
            continue
        click.echo('cannot find word list "{}"'.format(wl))
    return list(set(words))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号