Popular recipes by Richard Papworth http://code.activestate.com/recipes/users/108273/2001-05-29T09:35:03-07:00ActiveState Code RecipesRetrieving a line at random from a file of unknown size (Python)
2001-05-29T09:35:03-07:00Richard Papworthhttp://code.activestate.com/recipes/users/108273/http://code.activestate.com/recipes/59865-retrieving-a-line-at-random-from-a-file-of-unknown/
<p style="color: grey">
Python
recipe 59865
by <a href="/recipes/users/108273/">Richard Papworth</a>
(<a href="/recipes/tags/text/">text</a>).
</p>
<p>This procedure reads through a file of unknown size once, returning a random line from the file.</p>