[Tutor] if and things

2007-07-18 Thread elis aeris
# pixel[] is a list of tuples: (r,g,b) # pixel[1030*(y-a) + x][0] = r # pixel[1030*(y-a) + x][1] = g # pixel[1030*(y-a) + x][2] = b for a in range(0, 10): ifpixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][0] and pixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][2]: box = box

Re: [Tutor] if and things

2007-07-18 Thread elis aeris
given up? man i have a project to go live :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if and things

2007-07-18 Thread Tiger12506
It's nice to see you haven't given up. A few suggestions to make you code a little more creative. > import time > > import ImageGrab # Part of PIL > from ctypes import * > > # Load up the Win32 APIs we need to use. > class RECT(Structure): > _fields_ = [ >('left', c_ulong), >('top', c_u

Re: [Tutor] if and things

2007-07-18 Thread Tiger12506
> man that looks totally pythonic. What you had is correct though. Good job. JS ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if and things

2007-07-18 Thread elis aeris
man that looks totally pythonic. On 7/19/07, Ian Witham <[EMAIL PROTECTED]> wrote: try this: for a in range(10): r, g, b = pixel[1030*(y-a) + x] if g > r and g > b: box += 1 This is an example of "unpacking" a tuple into separate variables, r, g and b. On 7/19/07, elis aeris

[Tutor] if and things

2007-07-18 Thread elis aeris
full code below. # pixel[] is a list of tuples: (r,g,b) # pixel[1030*(y-a) + x][0] = r # pixel[1030*(y-a) + x][1] = g # pixel[1030*(y-a) + x][2] = b for a in range(0, 10): ifpixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][0] and pixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][2

Re: [Tutor] if and things

2007-07-18 Thread Ian Witham
try this: for a in range(10): r, g, b = pixel[1030*(y-a) + x] if g > r and g > b: box += 1 This is an example of "unpacking" a tuple into separate variables, r, g and b. On 7/19/07, elis aeris <[EMAIL PROTECTED]> wrote: # pixel[] is a list of tuples: (r,g,b) # pixel[1030*(y-