I have a bytes object:
a = b'067b'
How do I get a string from it? Like this:
"067b"
I've tried:
In [3]: str(a)
Out[3]: "b'067b'"
In [4]: import codecs
In [5]: codecs.decode(a,'hex')
Out[5]: b'\x06{'
In [6]: import binascii
In [7]: binascii.b2a_hex(a)
Out[7]: b'30363762'
In [8]: binascii.hexlify(a)
Out[8]: b'30363762'
Is there no way to do this?