update 02-03-2022
This commit is contained in:
parent
09a4b427c2
commit
013e9a2a59
3 changed files with 12 additions and 4 deletions
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"python.linting.pylintEnabled": false,
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.mypyEnabled": true
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
today
|
||||
today
|
||||
weather
|
||||
test
|
||||
6
main.py
6
main.py
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue