File Parsing Question

Zentrader zentraders at gmail.com
Wed Sep 12 18:07:41 EDT 2007


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.




More information about the Python-list mailing list