Printing the name of a variable

Simon Brunning simon at brunningonline.net
Fri Sep 10 12:26:24 CEST 2010


On 9 September 2010 20:43, Stephen Boulet <stephen.boulet at gmail.com> wrote:
> Does an arbitrary variable carry an attribute describing the text in
> its name? I'm looking for something along the lines of:
>
> x = 10
> print x.name
>>>> 'x'

<http://effbot.org/pyfaq/how-can-my-code-discover-the-name-of-an-object.htm>

-- 
Cheers,
Simon B.



More information about the Python-list mailing list