I have the following code:
output = io.BytesIO()
some_function(output) # some_function writes output to file n times
buffer = output.getbuffer()
output.getvalue()
output.getvalue() returns the following piece: b'\x01\x02\x03\x01\x02\x03\x01\x02\x03\x01
but imagine if this were a long piece.
the problem is with the get value() function that could potentially return a large number of data based on number of times some_function() is called. lets say n = 1000000. How would i process the binary data returned from get value() in chunks so that i can
write(chunk) for each chunk in get value
to the file?