Howto emulate pipe-like buffer in Python?

225 Views Asked by At

Is there a way to use StringIO buffer like pipe with lazy write? Is there a way to hook a function to be called when End Of File/String occurs on the StringIO object to append next lines that can be read? Already read lines should by disposed.

Or is available another object/library like StringIO? I don't want to use the operating system pipes and forking. I need to foist a file-like buffer to psycopg2.copy_from() but with behaviour like pipe.

Something like Efficient FIFO queue for arbitrarily sized chunks of bytes in Python and deque but line oriented.

0

There are 0 best solutions below