I\'m trying to find a way to print a string in hexadecimal. For example, I have this string which I then convert to its hexadecimal value.
my_string = \"deadbeef
You can try something like this I guess:
new_str = "" str_value = "rojbasr" for i in str_value: new_str += "0x%s " % (i.encode('hex')) print new_str
Your output would be something like this:
0x72 0x6f 0x6a 0x62 0x61 0x73 0x72