update 02-03-2022

This commit is contained in:
David Lawler 2022-03-02 17:51:34 +10:00
parent 09a4b427c2
commit 013e9a2a59
3 changed files with 12 additions and 4 deletions

5
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.mypyEnabled": true
}

View file

@ -0,0 +1,5 @@
today
today
weather
test

View file

@ -17,6 +17,8 @@ def most_likely(userQuestion):
mostLikelyIndex = likelihoodScore.index(max(likelihoodScore))
mostLikely = aList[mostLikelyIndex]
fileObject.close()
return mostLikely
def main():
@ -29,10 +31,6 @@ def main():
print ("I think that you asked " + "'" + (likelyQuestion['question']) + "'" + " and conclude that the answer is " + "'" + (likelyQuestion['answer']) + "'.\n")
# Open the file in append & read mode ('a+')
with open("asked_questions_log.txt", "a+") as file_object:
file_object.seek(0) # Move read cursor to the start of file.
data = file_object.read(100)
if len(data) > 0 :
# Append text at the end of file
file_object.write("\n")
file_object.write(userQuestion)