def write_to_stdout(data): sys.stdout.write(data + '\n') sys.stdout.flush() # The standard zlib.compressobj() accepts only positional arguments.