title: How to get the current open file line in python?
body: <p>Suppose you open a file, and do an seek() somewhere in the file, how do you know the current file line ?</p>
  
  <p>(I personally solved with an ad-hoc file class that maps the seek position to the line after scanning the file, but I wanted to see other hints and to add this question to stackoverflow, as I was not able to find the problem anywhere on google)</p>