title: it's possible to determine how many lines exist in file without per line iteration?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/845058/how-to-get-line-count-cheaply-in-python">How to get line count cheaply in Python?</a>  </p>
  </blockquote>
  
  
  
  <p>Good day. i have some code below, which implements per line file reading and counter iteration.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>My question is, are there methods to determine how many lines of text data in current file without per line iteration?</p>
  
  <p>Thanks!</p>