本文整理匯總了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