I was working off of the answer in this question: Python Interactive Shell Type Application
My code looks like this
def main():
while True:
s = input('> ')
if s == 'hello':
print('hi')
if s == 'exit':
break
if __name__ == "__main__":
main()
If I run it, and type hello, I get
File "<string>", line 1, in <module>
NameError: name 'hello' is not defined
How should I be listening for text, and calling different functions based on the result?