title: How to read a file that is continuously being updated by appending lines?
body: <p>In my terminal I am running:</p>
  
  <pre><code>curl --user dhelm:12345 \https://stream.twitter.com/1.1/statuses/sample.json &gt; raw-data.txt
  </code></pre>
  
  <p>curl's output is live streaming Twitter data which is being written on to a file raw-data.txt</p>
  
  <p>In python, </p>
  
  <pre><code> import json
   posts = []
  
   for line in open("/Users/me/raw-data.txt"):
      try:
          posts.append(json.loads(line))
      except:
          pass
  </code></pre>
  
  <p>I am reading the file in python and using json decoder and appending the results to posts.</p>
  
  <p>Now, the issue is I don't want my program to end when the python script reaches the end of file. instead I want to continue reading when the curl running on my terminal appends more posts to the file raw-data.txt.</p>