How to get class's name on runtime?

Anthony Baxter anthony at interlink.com.au
Thu May 9 04:16:15 EDT 2002


>>> =?iso-8859-1?Q?J=E4rvinen?= Petri wrote
> 
> Hey again
> 
> This must have been asked several times, but I'll give my try :)
> 
> How can I get class-instances name at runtime?
> 
> I have tried to use __name__ method, but that does not exist...

self.__class__.__name__

Anthony

-- 
Anthony Baxter     <anthony at interlink.com.au>   
It's never too late to have a happy childhood.






More information about the Python-list mailing list