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))
评论列表
文章目录