xor on strings
Joshua Muskovitz
joshm at taconic.net
Mon Feb 11 01:35:00 EST 2002
More information about the Python-list mailing list
Mon Feb 11 01:35:00 EST 2002
- Previous message (by thread): xor on strings
- Next message (by thread): xor on strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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' Is the test for '00' for anything other than the formatting of the string? Are you trying to find the brightest color, or something? -- # 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! =-----
- Previous message (by thread): xor on strings
- Next message (by thread): xor on strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list