I have a 4 byte int variable which contains ‘h264’ chars. what’s proper way to print it as char sequence as well.
x = 0x68323634 # h264
print(str(x))
current output is:
1748121140
expect output is:
h264
>Solution :
>>> x = 0x68323634
>>> x.to_bytes(4, "big").decode("ascii")
'h264'