io.BytesIO.writelines

BytesIO.writelines(sequence_of_strings) → None. Write strings to the file.

Note that newlines are not added. The sequence can be any iterable object producing strings. This is equivalent to calling write() for each string.