xor on strings
dsavitsk
dsavitsk at e-coli.net
Mon Feb 11 01:53:57 EST 2002
"Joshua Muskovitz" <joshm at taconic.net> wrote in message
news:3c6763c6_3 at corp.newsgroups.com...
> It isn't clear why you want to compare to '00', but this code should do
the
> trick nicely:
>
> >>> (r,g,b) = (56,156,12)
> >>> theString = '&H%02x%02x%02x' % (b,g,r) # note the order!
> >>> theString
> '&H0c9c38'
>
VB does BBGGRR for no reason that i understand.
> Is the test for '00' for anything other than the formatting of the string?
> Are you trying to find the brightest color, or something?
no, just formatting.
thanks for the suggestion. i had a bunch of if and len statements that
worked but didn't look like python is supposed to.
> --
> # Joshua Muskovitz
> # joshm at taconic.net
> def lyyrs(sig): return '-'.join(sig.split()+["ly y'rs"])
> lyyrs('Hire me! I need the work!')
>
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
More information about the Python-list
mailing list