s = utils.tohex (s)
This converts the string s to hexadecimal (printable) form. The string may contain binary zeroes. Use string.lower to make a lower-case version if that is what you prefer. eg. print (utils.tohex ("Nick Gammon")) --> 4E69636B2047616D6D6F6E
print (utils.tohex ("Nick Gammon")) --> 4E69636B2047616D6D6F6E