[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Increment Variable Name

Gabriel Genellina

1/25/2008 8:00:00 PM

En Wed, 23 Jan 2008 23:09:36 -0200, David Brochu <brochu121@gmail.com>
escribió:

> Basically what I am trying to do is pass each value from a list to
> the following line of code (where XXX is where I need to pass each
> value of the list
>
> tests = easygui.multchoicebox(message="Pick the test(s) you would
> like to run from the list below."
> , title="Validation Tests"
> ,choices=[XXX])
>
> If i were to manually pass values to this line it would appear like :
> tests = easygui.multchoicebox(message="Pick the test(s) you would
> like to run from the list below."
> , title="Validation Tests"
> ,choices=["Test 1","Test 2", "Test 3"])
>
> When I actually pass the list to the line of code, it works, however
> it doesn't really split the list by element. The desired output of
> this line of code would be a GUi that included a list consisting of
> each element from the passed list. Right now I can only get it to
> consist of a single element that contains every part of the list.

You should have posted this in the first place! No answer to your previous
specific question would have helped you in this case.
See http://catb.org/~esr/faqs/smart-questions...

Ok, you have a list containing all the possible choices. It doesn't matter
how did you build that list. Then, just pass *that* *list* as the choices
parameter to the function. By example:

all_tests = ["Test 1","Test 2", "Test 3"]
tests = easygui.multchoicebox(message="Pick the test(s) you would
like to run from the list below.", title="Validation Tests",
choices=all_tests)

(If you use [items] you are building a new list with a single element
which itself is the list of choices, and that's not what multchoicebox
expects).

--
Gabriel Genellina