Oct-05-2021, 08:02 PM
Hello,
Currently making a chat bot that helps with adding some items to a database. I want a user to be able to start adding something to a database but be able to cancel at anytime.
Here's my current code:
I found this thread which is a similar question to mine however I'm not sure exactly how to go about implementing that if it's the same solution.
Currently making a chat bot that helps with adding some items to a database. I want a user to be able to start adding something to a database but be able to cancel at anytime.
Here's my current code:
def foo():
def check(m):
if m == "stop":
return
msg = input("Type a msg: ")
check(msg)
msg2 = input("Type another message: ")
check(msg2)
msg3 = input("Type a third message: ")
foo()My thought process was to take the message and run it through a check that would exit out of the process however my check only exists out of the check() function and not the parent foo() function.I found this thread which is a similar question to mine however I'm not sure exactly how to go about implementing that if it's the same solution.
