python char to hex
tmp = "hello world"
print("".join(["{:02x}".format(ord(c)) for c in tmp]))
4
10
import codecs
x = codecs.encode(b"c", "hex")
print(x)
# b'63'
Thank you!
10
0
4
4
hex(ord("c"))
Thank you!
4
0
4.3
10
import codecs
codecs.encode(b"c", "hex")
Thank you!
10
0
Are there any code examples left?
New code examples in category Python