I expect I'm doing something wrong here, but whenever I try to insert the snippet to save session information for the chatbot, the terminal closes immediately with an error. Here's my source:
import aiml
k = aiml.Kernel()
#k.learn("std-startup.xml")
#k.respond("load aiml b")
#k.saveBrain("test.brn")
k.loadBrain("test.brn")
#while True: print k.respond(raw_input("> "))
keepAlive = True
while True:
output = k.respond(raw_input("> "))
print output,
session = k.getSessionData("Bob")
sessionFile = file("Bob.ses", "wb")
marshal.dump(session, sessionFile)
sessionFile.close()