Possible Duplicate:
How to get line count cheaply in Python?
Good day. i have some code below, which implements per line file reading and counter iteration.
def __set_quantity_filled_lines_in_file(self):
count = 0
with open(self.filename, 'r') as f:
for line in f:
count += 1
return count
My question is, are there methods to determine how many lines of text data in current file without per line iteration?
Thanks!