Read handle concatenation

kj no.email at please.post
Thu Nov 5 16:24:02 CET 2009




I want to be able to take two or more open read handles and
concatenate them into an object that behaves like a regular read
handle (i.e. a file object open for reading), but behind the scenes
it reads from the concatenated handles in sequence.  I.e. I want
the read-handle equivalent of the standard Unix utility cat.  (The
reason I can't use subprocess and cat for this is that I want to
concatenate read handles that do not necessarily come from files.)

The only way I know to do this from scratch is straightforward but
tedious, so I thought I'd better ask to see if there's already some
module that would facilitate this task.

TIA!

kynn



More information about the Python-list mailing list