[Tutor] create an empty array of images

bob gailer bgailer at gmail.com
Sat Jan 3 16:24:47 CET 2009


i i wrote:
> yes i want to clear the images before the next iteration,here is the 
> pseudo code what i want to do
>
> a = [ ]
>
> for i in range(self.numOne)
> a.append([i])
>  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 *for-in* statement
>
>
>
> 0 for i in range (self.numOne)
>
> 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()
>
>
I also don't understand your question. In addition to pseudocode would 
you give a description of what the user sees and does and how the end 
result looks to the user.

 From your code I think I would see a pink flower flashed numOne times.

Also please clean up the code. The indentations are messy.


-- 
Bob Gailer
Chapel Hill NC 
919-636-4239



More information about the Tutor mailing list