Canonical way of dealing with null-separated lines?

Douglas Alan nessus at mit.edu
Thu Feb 24 14:03:52 EST 2005


Christopher De Vries <devries at idolstarastronomer.com> writes:

> I'm not sure if there is a canonical method, but I would
> recommending using a generator to get something like this, where 'f'
> is a file object:

Thanks for the generator.  It returns an extra blank line at the end
when used with "find -print0", which is probably not ideal, and is
also not how the normal file line iterator behaves.  But don't worry
-- I can fix it.

In any case, as a suggestion to the whomever it is that arranges for
stuff to be put into the standard library, there should be something
like this there, so everyone doesn't have to reinvent the wheel (even
if it's an easy wheel to reinvent) for something that any sysadmin
(and many other users) would want to do on practically a daily basis.

|>oug



More information about the Python-list mailing list