Op 2017-10-04, Paul Moore schreef <[email protected]>:
> On 4 October 2017 at 16:08, Steve D'Aprano <[email protected]> wrote:
>> On Wed, 4 Oct 2017 08:19 pm, Thomas Nyberg wrote:
>>
>>> Hello,
>>>
>>> I was wondering if anyone here knew of any python libraries with
>>> interfaces similar to the bzip2 module which is also multithreaded in
>>> (de)compression? Something along the lines of (say) the pbip2 program
>>> but with bindings for python?
In a pinch:
with open("myoutfile.gz", "wb") as f:
sp = subprocess.Popen(("gzip",), stdin=subprocess.PIPE, stdout=f)
sp.stdin.write(b"Hello, world\n")
sp.stdin.close()
Does compression in a separate process ;-)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list