Printing variable names

Mike mike at odyne.com
Mon Jan 19 16:22:36 CET 2004


That makes life easy.  Problem solved!  Thanks all for the help.

Mike



> 
> You're lucky, functions "know" their name:
> 
> >>> def func1(): pass
>  ...
> >>> def func2(): pass
>  ...
> >>> for f in [func1, func2]:
> ...     print f.__name__
> ...
> func1
> func2
> 
> Peter



More information about the Python-list mailing list