Nov-09-2018, 02:31 PM
When you loop through the lines in a file like that, you will have a newline character at the end of each line. Try changing the last comparison to
Also, file is a built-in type in Python. If you use it as a variable name, it might mess up other code that depends on it.
if txt.strip() == stop:
, or setting stop = 'end\n'
.Also, file is a built-in type in Python. If you use it as a variable name, it might mess up other code that depends on it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures