trivia.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def from_data(cls, question):
        return cls(
            category=question['category'],
            type=question['type'],
            question=unescape(question['question']),
            answer=unescape(question['correct_answer']),
            incorrect=tuple(map(unescape, question['incorrect_answers'])),
        )

# How many times should the cache be used before making an API request
# to get more questions, the lower this number, the more likely it will
# make an HTTP request. Set to 0 to always use the API
#
# Note that the toggler is only called when the trivia session doesn't
# have any questions in the queue, so be careful when making this really
# high. Otherwise the question cache might never be filled.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号