chat.py 文件源码

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

项目:Jarvis 作者: sukeesh 项目源码 文件源码
def main(self):
    brain = Brain()
    print_say("Ask me anything\n type 'leave' to stop", self, Fore.BLUE)
    stay = True

    while stay:
        if six.PY2:
            text = str.upper(raw_input(Fore.RED + ">> " + Fore.RESET))
        else:
            text = str.upper(input(Fore.RED + ">> " + Fore.RESET))
        if text == "LEAVE":
            print_say("thanks for talking to me", self)
            stay = False
        else:
            print_say(brain.respond(text), self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号