4 ms·
In python 3 you can use: b1 = b'bytes' s = str(b1, 'utf-8') b2 = bytes(s, 'utf-8') instead of using encode and decode.
by tyilo 10y ago
In python 3 you can use:
b1 = b'bytes'
s = str(b1, 'utf-8')
b2 = bytes(s, 'utf-8')
instead of using encode and decode.
- forgottenacc57 10y agoThere should be one obvious way to do it.