Printing a variable's name not its value

travislspencer at gmail.com travislspencer at gmail.com
Wed Jul 20 16:56:11 EDT 2005


travislspencer at gmail.com wrote:
> Bruno Desthuilliers wrote:
> > def printVerbose(*args, **kwargs):
> >
> > >     if VERBOSE in globals:
> > >         for a in args:
> > >             if a in globals:
> > >                 value = globals[a]
> >
              for k, v in kwargs.iteritems():
> > >             print "%s: %s" % (k, v)
> > >
>
> Perfect.  Thanks for the pointer.

Well, almost perfect ;)

--

Regards,

Travis Spencer




More information about the Python-list mailing list