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