In Python 3, one can format a string like:
"{0}, {1}, {2}".format(1, 2, 3)
But how to format bytes?
b"{0}, {1}, {2}".format(1, 2, 3)
raises AttributeError: 'bytes' object has no attribute 'format'
.
If there is no format
method for bytes, how to do the formatting or "rewriting" of bytes?
And as of 3.5 %
formatting will work for bytes
, too!
https://mail.python.org/pipermail/python-dev/2014-March/133621.html