SyntaxFix
Write A Post
Hire A Developer
Questions
If you want the first line and then you want to perform some operation on file this code will helpful.
with open(filename , 'r') as f: first_line = f.readline() for line in f: # Perform some operations