import random
head = 0
tail = 0
while (head + tail) < 100:
coin = random.randrange(2) <-- move this line inside the loop
if coin == 0:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of . ,
Sent: Tuesday, May 17, 2005 4:12 PM
To: tutor@python.or
Try using getdata() on the Image:
im = Image.open("oxygen.png")
im.load()
d = im.getdata()
print list(d)
That will give you a list of the form:
[(r,g,b,a), (r,g,b,a)... ]
Where r=red, g=green, b=blue, and a=alpha. When r==g==b, you have a
gray pixel.
-Original Message-
From: [EMAIL P
A shade of gray is made by having r == g == b.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of D. Hartley
Sent: Tuesday, May 10, 2005 4:46 PM
Cc: tutor@python.org
Subject: Re: [Tutor] zip question
I tried to look at the image band by band, but got three
Try:
print X.readline()
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Servando Garcia
Sent: Tuesday, May 10, 2005 2:37 PM
To: Python help
Subject: [Tutor] following the chain
Thanks to the many hints from the list I have made it to level four, of
the py