Jan-22-2017, 11:03 AM
what is the best way to convert a string to hexadecimal?
the purpose is to get the character codes to see what is being read in from a file.
i already have command line tools that display the file in hexadecimal. i want to match that up with what the python script is doing. something that is suitable for making such tools might work. i tried binascii.hexlify() but it wanted a bytes-like object. i have a string for now.
for example i have a misbehaving script. i want to drop in a slim piece of code to have it print the string in hex.
the purpose is to get the character codes to see what is being read in from a file.
i already have command line tools that display the file in hexadecimal. i want to match that up with what the python script is doing. something that is suitable for making such tools might work. i tried binascii.hexlify() but it wanted a bytes-like object. i have a string for now.
for example i have a misbehaving script. i want to drop in a slim piece of code to have it print the string in hex.