Python read website data line by line when available
<p>I  am using <code>urllib2</code> to read the data from the url, below is the code snippet :</p>

<pre><code>data = urllib2.urlopen(urllink)
for lines in data.readlines():
  print lines
</code></pre>

<p>Url that I am opening is actually a cgi script which does some processing and prints the data in parallel. CGI script takes around 30 minutes to complete. So with the above code, I could see the output only after 3o minutes when the execution of CGI script is completed.</p>

<p>How can I read the data from the url as soon as it is available and print it.</p>
