[Tutor] :initialize a for loop

i i iaidas4 at gmail.com
Fri Jan 2 13:25:11 CET 2009


Hi,
    i am  making an activity in glade.here is the code


        self.numOne = random.randint(1,10)
    for i in range(self.numOne):

        self.image = gtk.Image()

        self.image.set_from_file("./Pink-Flower-32x32.png")

        self.fixed.put(self.image, i*25, 0)

        self.image.show()

here u can see i have declared an array and it makes required number of
images,i want to initialize the array or empty it before the next loop.
how can we initialize or empty a for-in statement in python.





thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090102/66f72dfb/attachment.htm>


More information about the Tutor mailing list