【发布时间】:2017-10-12 18:19:08
【问题描述】:
import aiml
import os
kernel = aiml.kernel()
if os.path.isfile("bot_brain.brn"):
kernel.bootstrap(brainFile = "bot_brain.brn")
else:
kernel.bootstrap(learnFiles = "std-startup.xml", commands = "load aiml b")
kernel.savebrain("bot_brain.brn")
while True:
print kernel.respond(raw_input("Enter Your Message")).strip()
aiml.kernel()
它会抛出类似
的错误Traceback(最近一次调用最后一次): 文件“init.py”,第 3 行,在 内核=目标。内核() AttributeError:“模块”对象没有属性“内核”
【问题讨论】:
-
推荐这个post,这可能会有所帮助。