I count number of rows (lines) in a file using Python in the following method:
n = 0
for line in file('input.txt'):
n += 1
print n
I run this script under Windows.
Then I count the number of rows in the same file using Unix command:
wc -l input.txt
Counting with Unix command gives a significantly larger number of rows.
So, my question is: Why Python does not see all the rows in the file? Or is it a question of definition?