Little Q: how to print a variable's name, not its value?

Stewart Midwinter stewart.midwinter at gmail.com
Thu Mar 31 02:57:14 EST 2005


thanks Aaron, I'll pick what's behind door no. 1 !
That is, I liked your first solution.  Having said that, I would only
have to place either solution once in my code, then I could call it
again and again.  So either one would be just as 'light' in actual
usage.

Taking this idea a little further, I'd like to build a 'variable
inspector' for my GUI app, so that I don't have to resort to debug
statements.  Instead, I could pop open a window that lists every
variable that has an expected None, string, int or float value, and
select any one in order to see its value at that time.  I believe your
method would be useful in that situation as well, no?

cheers,
-- 
Stewart Midwinter
stewart at midwinter.ca
stewart.midwinter at gmail.com
Skype: midtoad



More information about the Python-list mailing list