Re:Reddit is hiring. We're looking for 3 rockstar programmers.
by dpritchett on Friday February 11, 2011 @02:18PM
(#2207730)
Hey, this was actually easier and more fun than expected! I tried it out at the Python REPL and now I have a mostly-working implementation using os.path.getsize(), file.tell(), file.seek(), and file.readline(). The fun part is that I hadn't used the first three of those functions in Python before today. Layering a binary search on top of this looks as easy as
*REDACTED*
with some edge case checking and start-of-next-line seeking.
I'd have thought there was more to this, but it seems pretty straightforward.
Lessons learned for me: Python standard library docs are great, repl development is great, and text files are fun.
I'd have thought there was more to this, but it seems pretty straightforward.
Lessons learned for me: Python standard library docs are great, repl development is great, and text files are fun.