xor on strings

Andreas Kostyrka andreas at mtg.co.at
Fri Mar 1 03:33:19 EST 2002


On Mon, 11 Feb 2002 05:04:59 GMT
"dsavitsk" <dsavitsk at e-coli.net> wrote:

> the truncate part is the problem.  I am building VB Hex strings to send to a
> VB server.  so
> 
> >>> red = hex(56)[2:4]
What about:
red=56
green=156
blue=12
thestring="%02x%02x%02x" % (red,green,blue)
> >>> green = hex(156)[2:4]
> >>> blue = hex(12)[2:4]
> >>> thestring = '&H' + blue + green + red
> 
> but here, since the blue string is only 1 character it throws the rest off.

Andreas




More information about the Python-list mailing list