SyntaxFix
Write A Post
Hire A Developer
Questions
If you don't mind importing then fileinput does exactly what you need (this is you can read the line number of the current line)