Re: char string 2 hex string

2008-02-01 Thread Antonio Chay
On Jan 31, 7:09 pm, Paul Rubin wrote: > Antonio Chay <[EMAIL PROTECTED]> writes: > > "AAA" should be "414141" > > 'AAA'.encode('hex') 8-O Cool stuff! Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: char string 2 hex string

2008-01-31 Thread Jared Grubb
You could also do: "".join(['%02x' % ord(c) for c in 'AAA']) On 31 Jan 2008, at 14:09, Paul Rubin wrote: Antonio Chay <[EMAIL PROTECTED]> writes: "AAA" should be "414141" 'AAA'.encode('hex') -- http://mail.python.org/mailman/listinfo/python-list On 31 Jan 2008, at 14:05, Antonio Chay wrot

Re: char string 2 hex string

2008-01-31 Thread Paul Rubin
Antonio Chay <[EMAIL PROTECTED]> writes: > "AAA" should be "414141" 'AAA'.encode('hex') -- http://mail.python.org/mailman/listinfo/python-list