<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:12pt"><div>Forwarding to list...<br></div><div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2">----- Forwarded Message ----<br><b><span style="font-weight: bold;"></span></b></font><br>yes i want to clear the images before the next iteration,here is the pseudo code what i want to do<br><br>a = [ ]<br>for i in range(self.numOne)<br>a.append([i])<br>&nbsp;to create an empty array, and append the index i to the array and pass this index to gtk image,how i can do this in <b>for-in</b> statement<br>
<br><br><br>0 for i in range (self.numOne)<br>self.numOne = random.randint(1,10)<br>
 &nbsp; for i in range(self.numOne):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image = gtk.Image()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image.set_from_file("./<div class="Ih2E3d">Pink-Flower-32x32.png")<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.fixed.put(self.image, i*25, 0)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image.show()<br>
</div><br><br><br>thanks<br><br><br><br><br><br><br><br><div class="gmail_quote">On Fri, Jan 2, 2009 at 9:45 PM, Alan Gauld <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
"i i" &lt;<a rel="nofollow" ymailto="mailto:iaidas4@gmail.com" target="_blank" href="mailto:iaidas4@gmail.com">iaidas4@gmail.com</a>&gt; wrote in<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
 &nbsp; self.numOne = random.randint(1,10)<br>
 &nbsp; for i in range(self.numOne):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image = gtk.Image()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image.set_from_file("./Pink-Flower-32x32.png")<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.fixed.put(self.image, i*25, 0)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.image.show()<br>
<br></div><div class="Ih2E3d">
images,i want to initialize the array or empty it before the next loop.<br>
how can we initialize or empty a for-in statement in python.<br>
</div></blockquote>
<br>
I don't understand the question? What is it you want to initialise<br>
or empty?<br>
<br>
Do you just want to break out of the loop?<br>
Do you want to clear the images you have already created<br>
at some point?<br>
<br>
Can you show us some pseudo code that would illustrate<br>
how you would like the program to work?<br><font color="#888888">
<br>
<br>
-- <br>
Alan Gauld<br>
Author of the Learn to Program web site<br>
<a rel="nofollow" target="_blank" href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a> <br>
<br>
_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a rel="nofollow" ymailto="mailto:Tutor@python.org" target="_blank" href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a rel="nofollow" target="_blank" href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>
</font></blockquote></div><br>
</div></div></div></body></html>