This should work, but it won't win any marks for style:

classname = "MyClass"
instance = eval(classname)
dir(instance)

Karl
> Hi,
> If i have a class name as a string how can i get a list of the field 
> names for the class.
> tks,
> PJ
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Python Ireland" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ie/group/pythonireland?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to