On Thu, 25 May 2006, Alan Gauld wrote: > In general I prefer to use string formatting to convert into hex > format. I'm a big fan of hexlify: >>> from binascii import hexlify >>> s="abc-123" >>> hexlify(s) '6162632d313233'