wiki_summary.py 文件源码

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

项目:WikiSummary 作者: Mikerah 项目源码 文件源码
def get_random_articles_v2():
    """Retrieves random articles until the user types 'stop' """
    ans = input('Press enter to continue or stop to stop: ')
    while ans != 'stop':
        try:
            print(wikipedia.summary(wikipedia.random()))
            print()
            ans = input('Press enter to continue or stop to stop: ')
        except wikipedia.exceptions.DisambiguationError:
            print(wikipedia.summary(wikipedia.random()))
            print()
            ans = input('Press enter to continue or stop to stop: ')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号