Python has a very strange problem. These two did not seem to help:
Checking user input strings in Python and a quick way to compare strings in python
I wrote the following small test.py program:
import sys
while True:
print("\n")
print("Type exit to exit: ")
inputvar = str(input())
print("Input: "+inputvar)
if inputvar == 'exit':
print("Exiting!")
sys.exit("\n\nProgram quit.")
else:
print("Still here")
The current version does not seem to come with exit, 'exit'or "exit". Using input()instead str(input())does not seem to matter, and using isor ininstead ==does not matter either.
I am using Python 3.2 on Windows 7.
source
share