SyntaxFix
Write A Post
Hire A Developer
Questions
If you want to convert b'\x61' to 97 or '0x61', you can try this:
[python3.5] >>>from struct import * >>>temp=unpack('B',b'\x61')[0] ## convert bytes to unsigned int 97 >>>hex(temp) ##convert int to string which is hexadecimal expression '0x61'
Reference:https://docs.python.org/3.5/library/struct.html