[Tutor] Question on regular expressions (fwd)

Terry Carroll carroll at tjc.com
Thu May 25 21:52:19 CEST 2006


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'





More information about the Tutor mailing list