Pyglade, gtk, howto write more efficiently, and waste less code?

Gabriel Genellina gagsl-py at yahoo.com.ar
Wed Sep 20 18:08:27 EDT 2006


At Wednesday 20/9/2006 10:06, Pipiten wrote:

>I have:
>         self.paths = ["","path1","path2","path3","path4","path5"]
>         self.paths[1] = self.wTree.get_widget("path1")
>         self.paths[2] = self.wTree.get_widget("path2")
>         self.paths[3] = self.wTree.get_widget("path3")
>         self.paths[4] = self.wTree.get_widget("path4")
>         self.paths[5] = self.wTree.get_widget("path5")
>
>what about if i have 30 widgets? how can i "get" them all?

Is this what you want?

for i,path in enumerate(self.paths):
   self.paths[i] = self.wTree.get_widget(path)



Gabriel Genellina
Softlab SRL 


	
	
		
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list