variable name using a for

Alex alx5962NOSPAN at yahoo.com
Tue Mar 2 14:32:51 EST 2004


Thank you very much for the reply!

In fact I created a list in a variable and I have to create x numbers of
butons, depending on how many values there's in the list.

so in my code:
for x in range(nbSujets):
  self.button1 = xbmcgui.ControlButton(50, 100, 40, 30, "B"+str(x) )
  self.addControl(self.button1)

But in fact I need self.buttonX as I need different actions on each button.
And the dictionnary here doesn't help I think...
I may find tricks to cheat, but it would make dirty code or bad results on
screen...

So any hint to make this work ?

Thanks again

Alex








More information about the Python-list mailing list