SyntaxFix
Write A Post
Hire A Developer
Questions
There is no specific method to read number of lines exposed by file object.
I guess the easiest way would be following:
lines =[] with open(file_name) as f: lines.extend(f.readline() for i in xrange(N))