I'm assuming you know that python has a file.seek(), but you have to know the number of bytes you want to move from the beginning of the file or from the current location. You could save the length of the previous record, and use file seek to backup and then move forward, but it is simpler to save the previous rec or use readlines() if the file will fit into a reasonable amount of memory.
-- http://mail.python.org/mailman/listinfo/python-list