Yup, I actually had log files in mind, too.  I process Apache logs from an 8-way cluster every 15 minutes. There are 32,000 sites on said cluster; that's a lot of log data!  <br><br>I didn't actually think anyone would go *try* to open("war_and_peace.txt").readlines().. I just meant it as a generalization for "really large file." =)
<br><br>-Jeff<br><br><div><span class="gmail_quote">On 7/25/07, <b class="gmail_sendername">Jay Loden</b> <<a href="mailto:python@jayloden.com">python@jayloden.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Grant Edwards wrote:<br>> On 2007-07-25, Jeff <<a href="mailto:jeffober@gmail.com">jeffober@gmail.com</a>> wrote:<br>><br>>> That might be a memory problem if you are running multiple processes<br>>> regularly, such as on a webserver.
<br>><br>> I suppose if you did it in parallel 50 processes, you could use<br>> up 250MB of RAM.  Still not a big deal on many servers.  A<br>> decent OS will swap regions that aren't being used to disk, so
<br>> it's likely not to be a problem.<br><br>Or, you might be reading from a text file dramatically larger than a 3MB copy of War and Peace. I regularly deal with log files that are often many times that, including some that have been well over a GB or more. Trust me, you don't want to read in the entire file when it's a 
1.5GB text file. It's true that many times readlines() will work fine, but there are also certainly cases where it's not acceptable for memory and performance reasons.<br><br>-Jay<br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">
http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>