print char by its hex representation python code example
Example 1: python char to hex
tmp = "hello world"
print("".join(["{:02x}".format(ord(c)) for c in tmp]))
Example 2: get hex code of character python
import codecs
codecs.encode(b"c", "hex")