Re: Retrieving a variable's name.

2007-08-21 Thread Simon Brunning
On 8/21/07, rodrigo <[EMAIL PROTECTED]> wrote: > How would I go about retrieving a variable's name (not its value)? http://effbot.org/pyfaq/how-can-my-code-discover-the-name-of-an-object.htm -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk:

Re: Retrieving a variable's name.

2007-08-21 Thread Steve Holden
rodrigo wrote: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 > b: 200 > > I get the feeling this

Re: Retrieving a variable's name.

2007-08-21 Thread rodrigo
You're right, Paul, Evan, James, I should just use a dictionary. Thanks! Rodrigo -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving a variable's name.

2007-08-20 Thread James Stroud
rodrigo wrote: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 > b: 200 > > I get the feeling this

Re: Retrieving a variable's name.

2007-08-20 Thread Evan Klitzke
On 8/20/07, Evan Klitzke <[EMAIL PROTECTED]> wrote: > On 8/20/07, rodrigo <[EMAIL PROTECTED]> wrote: > > How would I go about retrieving a variable's name (not its value)? I > > want to write a function that, given a list of variables, returns a > > string w

Re: Retrieving a variable's name.

2007-08-20 Thread Paul Rubin
rodrigo <[EMAIL PROTECTED]> writes: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 > b: 200 > >

Re: Retrieving a variable's name.

2007-08-20 Thread Evan Klitzke
On 8/20/07, rodrigo <[EMAIL PROTECTED]> wrote: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 > b:

Re: Retrieving a variable's name.

2007-08-20 Thread Gabriel Genellina
On 20 ago, 22:03, rodrigo <[EMAIL PROTECTED]> wrote: > How would I go about retrieving a variable's name (not its value)? I > want to write a function that, given a list of variables, returns a > string with each variable's name and its value, like: > > a: 100 >

Retrieving a variable's name.

2007-08-20 Thread rodrigo
How would I go about retrieving a variable's name (not its value)? I want to write a function that, given a list of variables, returns a string with each variable's name and its value, like: a: 100 b: 200 I get the feeling this is trivial, but I have been unable to find an answer