title: Get only new lines from file
body: <p>Currently i have this piece of code, but it reads all lines, and then watch the file with the while True statement:</p>
  
  <pre><code>with open('/var/log/logfile.log') as f:
          while True:
              line = f.readline()
              if not line:
                  time.sleep(1)
              else:
                  print(line)
  </code></pre>
  
  <p>I actually only need new lines coming after the lines already detected when opening the file - anybody who can help me out? Maybe a better way to watch it aswell, than with the while statement? </p>
  
  <p>Another problem is that on Linux machines the script is actually locking the file so it can not be written to, before i close the script again. On OS X it works fine. Could also be nice with an idea to work around this.</p>
  
  <p>Hope there is somebody out there who have been working with something similar.</p>