Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > help - obtaining the type of the object usingtp_name

Thread Tools

help - obtaining the type of the object usingtp_name

Mrinalini Kulkarni
Posts: n/a

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)

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Obtaining Correct Type with usage of ParseControl() bruce barker ASP .Net 0 09-25-2008 04:36 AM
Obtaining class instance of generic quantified type Rakesh Java 4 04-24-2008 07:43 PM
Obtaining column type in OCI8 Sean Nakasone Ruby 1 11-11-2007 03:34 AM
Obtaining column type in Oracle table Sean Nakasone Perl Misc 1 11-08-2007 12:53 PM
"gridview Object does not match target type" error during binding collection of different type object ASP .Net 2 08-06-2006 03:12 PM