# 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
given up? man i have a project to go live :)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
> 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
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
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
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-