pretty basic: get variable name from list of strings?

chris
Mon Jul 29 23:37:49 EDT 2002


On 30 Jul 2002 02:18:11 +0200, Chris Liechti <cliechti at gmx.net> wrote:

>
>box = []    	#create an empty list
>#and populate it:
>for j in range(1,100):
>    	 id = wxNewId()
>      box = wxRadioBox(self, id, name, wxDefaultPos,
>              wxDefaultSize, TeamList[j], 1, wxRA_SPECIFY_COLS)
>      EVT_RADIOBOX(self, id, self.EvtRadioBox)
>      self.boxes.append(box)
>
>and EvtRadioBox can find out which was the event source, no need to write 
>100 distict functions...

Hi other chris,

thanks for the advice.  i'm definitely new to programming in addition
to python, so I appreciate the big-picture advice.

leaving that for another day, my quick follow-up question is: is the
ID passed to the EvtRadioBox function?  Because I don't want all 100
radio buttons to do the *exact* same thing, I need it to be slightly
RadioBox (id) specific, something like   print id  .  Alternatively,
are arguments passable to the general event function?

thanks again for your time and instruction chris,
chris



More information about the Python-list mailing list