Feb-23-2021, 04:45 PM
I think the way you've done it above is fine. Bytes were the original str class in python before python3, so it defaults to printing the string representation. If you don't mind viewing it as hex then maybe:
>>> bstr = b'r\xd4M\xdb\xbd\xddp' >>> bstr.hex(sep=",") '72,d4,4d,db,bd,dd,70'But your listcomp to show it as decimal is perfectly good.