Gee, there's no end to the amount of $<magic> that Perl provides
that's actually useful :-) Let's see how we can simulate this in
Python... If you don't mind reading your file in all at once, try
this:
import string
file = open(...) # open the file
separator = '\0' # can be any string, possibly multiple characters
buffer = file.read()
records = string.splitfields(buffer, separator)
(Note that the separator won't be part of the records, unlike the list
returned by file.readlines() or the line returned by file.readline().)
--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>