本文整理汇总了Python中rivescript.RiveScript._dump方法的典型用法代码示例。如果您正苦于以下问题:Python RiveScript._dump方法的具体用法?Python RiveScript._dump怎么用?Python RiveScript._dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rivescript.RiveScript
的用法示例。
在下文中一共展示了RiveScript._dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: input
# 需要导入模块: from rivescript import RiveScript [as 别名]
# 或者: from rivescript.RiveScript import _dump [as 别名]
For a more full-fledged example, try running: `python rivescript brain`
This will run the built-in Interactive Mode of the RiveScript library. It has
some more advanced features like supporting JSON for communication with the
bot. See `python rivescript --help` for more info.
example3.py is just a simple script that loads the RiveScript documents from
the 'brain/' folder, and lets you chat with the bot.
Type /quit when you're done to exit this example.
""")
user = "localuser"
while True:
msg = input("You> ")
if msg == '/quit':
quit()
elif msg == '/dump':
rs._dump()
elif msg.startswith('/user '):
user = msg[6:].strip()
print("User changed to: " + user)
elif msg.startswith('/exec '):
eval(msg[6:].strip(), globals(), locals())
else:
reply = rs.reply(user, msg, False)
print("Bot>", reply)
# vim:expandtab