I'm reading in a text file using the command line via input() in Python 3, and lines in the file that appear numerical are being automatically treated as integers, causing errors. My understanding is that input() is not supposed to do any evaluation, and should treat these as strings. What is causing this behavior and how do I prevent it?
EDIT: For a cleaner example, if my code instead simply reads
cases = input()
print(type(cases))
My input file reads:
100
4 2
And I type into cmd:
script.py < input_file.txt > output_file.txt
My output file will contain
<type 'int'>