Re-reading file when cycling over a file object in Python
<p>From this context:</p>

<pre><code>import itertools
lines = itertools.cycle(open('filename'))
</code></pre>

<p>I'm wondering how I can implement that same 'feature' but rereading the file when it reaches the end, so if the file got changed since first iteration it's reloaded before starts another cycle. (hope I've explained well)</p>

<p>Thank you in advance! :)</p>
