Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage: brain.py [-h] question brain.py: error: the following arguments are required: question #1

Open
rezadustman opened this issue Jan 9, 2021 · 1 comment

Comments

@rezadustman
Copy link

import aiml
import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("question",help="Go ahead with your question!")
args = parser.parse_args()
kernel = aiml.Kernel()
kernel.verbose(False)
kernel.setBotPredicate("name", "Rebecca")
if os.path.isfile("bot_brain.brn"):
kernel.bootstrap(brainFile = "bot_brain.brn")
else:
kernel.bootstrap(learnFiles = "startup.xml", commands = "'LOAD AIML B")
kernel.saveBrain("bot_brain.brn")

kernel now ready for use

kernel.respond(args.question)
kernel.saveBrain("bot_brain.brn")


error

(venv) (base) C:\REZA\TUGAS REZA\chatbot15>py brain.py
usage: brain.py [-h] question
brain.py: error: the following arguments are required: question

@breadbrowser
Copy link

breadbrowser commented Jan 13, 2022

i get this

File "D:\downloads\simple-chat-bot-master\brain.py", line 18
print kernel.respond(args.question)
---------- ^
SyntaxError: invalid syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants