[python] how to get class name from a object?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[python] how to get class name from a object?

Skull-3

Dear,

I have a problem to export a function:getClassName, my code like this:

in c++:
class MyObj
{
    ...
}

const char* getClassName(PyObject *obj) # or getClassName(object obj)
{
    # how to get class name from PyObject(or object)??? <== my problem
    ...
}

in python:

... print getName(MyObj)
... "MyObj"

Anyone could help me? thanks in advance.

--
- Skull


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding