help - obtaining the type of the object usingtp_name

Discussion in 'Python' started by Mrinalini Kulkarni, Dec 25, 2011.

  1. Hello,

    I have embedded python into a vc++ app. I need to obtain type of the
    variable defined in the python script, in my c++ code.

    PyObject *pMyObject; -> assume points to a variable defined in the
    python script

    Now I want to do something like this

    const char * typeName;

    typeName = pMyObject->ob_type->tp_name

    Is this possible ? I tried doing this but it crashes.

    What is the alternative way for getting the name of the type from
    python. Is there a function available for this purpose such that I can
    obtain the address of that function using GetProcAddress and then use it
    for determining the type. (I am required to link to python dynamically)

    thanks,
    MK
     
    Mrinalini Kulkarni, Dec 25, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jediknight

    Obtaining Graphics Object

    jediknight, Jul 18, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,345
    Kelly Herald
    Jul 19, 2006
  2. Rakesh
    Replies:
    4
    Views:
    3,886
  3. bruce barker
    Replies:
    0
    Views:
    440
    bruce barker
    Sep 25, 2008
  4. Sean Nakasone

    Obtaining column type in OCI8

    Sean Nakasone, Nov 7, 2007, in forum: Ruby
    Replies:
    1
    Views:
    141
    KUBO Takehiro
    Nov 11, 2007
  5. Sean Nakasone

    Obtaining column type in Oracle table

    Sean Nakasone, Nov 8, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    119
    Brian McCauley
    Nov 8, 2007
Loading...

Share This Page