Binary buffer in Python

You are probably looking for io.BytesIO class. It works exactly like StringIO except that it supports binary data:

from io import BytesIO
bio = BytesIO(b"some initial binary data: \x00\x01")

StringIO will throw TypeError:

from io import StringIO
sio = StringIO(b"some initial binary data: \x00\x01")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)