Re: [Tutor] Problem with a while loop.

2005-05-17 Thread Goldie, Josh
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

Re: [Tutor] RGB, images

2005-05-11 Thread Goldie, Josh
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

Re: [Tutor] zip question

2005-05-10 Thread Goldie, Josh
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

Re: [Tutor] following the chain

2005-05-10 Thread Goldie, Josh
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