Re: Increment Variable Name

2008-01-25 Thread Gabriel Genellina
En Wed, 23 Jan 2008 23:09:36 -0200, David Brochu <[EMAIL PROTECTED]> 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)

Re: Increment Variable Name

2008-01-25 Thread David Brochu
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"

Re: Increment Variable Name

2008-01-24 Thread Terry Reedy
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:fdff5a3c-376c-41da-bc7c-| > Do you want to do this?: | > locals()['var'+str(1)] = "spam" | | As I recently learnt in this newsgroup, that's not guaranteed to work. | >From http://docs.python.org/lib/built-in-funcs.html | | Warning: The conte

Re: Increment Variable Name

2008-01-24 Thread Paul Hankin
On Jan 24, 12:02 pm, janislaw <[EMAIL PROTECTED]> wrote: > On Jan 23, 11:45 pm, David Brochu <[EMAIL PROTECTED]> wrote: > > > This is probably really trivial but I'm stumped :-( > > > Does anyone know how to increment a variable name? > > > For example: > > > I know the length of a list and I w

Re: Increment Variable Name

2008-01-24 Thread janislaw
On Jan 23, 11:45 pm, David Brochu <[EMAIL PROTECTED]> wrote: > This is probably really trivial but I'm stumped :-( > > Does anyone know how to increment a variable name? > > For example: > > I know the length of a list and I want to pass each element of a list   > to a unique variable, thus I w

Re: Increment Variable Name

2008-01-24 Thread Diez B. Roggisch
Grant Edwards schrieb: > On 2008-01-23, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> David Brochu schrieb: >>> This is probably really trivial but I'm stumped :-( >>> >>> Does anyone know how to increment a variable name? >>> >>> For example: >>> >>> I know the length of a list and I want to

Re: Increment Variable Name

2008-01-23 Thread Pablo Ziliani
David Brochu wrote: > Pablo - Thanks for the reply. > > 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

Re: Increment Variable Name

2008-01-23 Thread Ben Finney
Pablo Ziliani <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > This has a very bad code smell (...) > > > > \ `\ _o__) Ben Finney > > That is forcefulness. > (sorry, couldn't resist) I suspect that's a comment on my online nickname, "bignose", and talking about code smells. Nevertheless, it'

Re: Increment Variable Name

2008-01-23 Thread Grant Edwards
On 2008-01-23, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > David Brochu schrieb: >> This is probably really trivial but I'm stumped :-( >> >> Does anyone know how to increment a variable name? >> >> For example: >> >> I know the length of a list and I want to pass each element of a list to

Re: Increment Variable Name

2008-01-23 Thread Diez B. Roggisch
David Brochu schrieb: > This is probably really trivial but I'm stumped :-( > > Does anyone know how to increment a variable name? > > For example: > > I know the length of a list and I want to pass each element of a list to > a unique variable, thus I want to increment variable names. If t

Re: Increment Variable Name

2008-01-23 Thread Pablo Ziliani
Ben Finney wrote: > This has a very bad code smell (...) > > \ `\ _o__) Ben Finney That is forcefulness. (sorry, couldn't resist) -- http://mail.python.org/mailman/listinfo/python-list

Re: Increment Variable Name

2008-01-23 Thread Ben Finney
David Brochu <[EMAIL PROTECTED]> writes: > I know the length of a list and I want to pass each element of a > list to a unique variable, thus I want to increment variable names. > If the list length = 4, i want to have the following variables: > var1, var2, var3, var4. This has a very bad code sm

Re: Increment Variable Name

2008-01-23 Thread Pablo Ziliani
Hi David, David Brochu wrote: > I know the length of a list and I want to pass each element of a list > to a unique variable, thus I want to increment variable names. If the > list length = 4, i want to have the following variables: var1, var2, > var3, var4. yuck... no, believe me, you prob

Increment Variable Name

2008-01-23 Thread David Brochu
This is probably really trivial but I'm stumped :-( Does anyone know how to increment a variable name? For example: I know the length of a list and I want to pass each element of a list to a unique variable, thus I want to increment variable names. If the list length = 4, i want to have