Re: [C++-sig] Accessing Class Member Function from Python

2012-06-09 Thread Nagaraju
Hi All, Sorry for spamming. I got it worked. Regards, Raju. On Sat, Jun 9, 2012 at 11:28 AM, Nagaraju wrote: > Hi Nat and All, > > I have created a TestProject.pyd file and imported it into Python as > import TestProject > planet = TestProject.MyClass() > planet.add(1,1) > > When I execute the

Re: [C++-sig] Accessing Class Member Function from Python

2012-06-08 Thread Nagaraju
Hi Nat and All, I have created a TestProject.pyd file and imported it into Python as import TestProject planet = TestProject.MyClass() planet.add(1,1) When I execute the last statement, Python is giving following error: Traceback (most recent call last): File "", line 1, in planet.add(int(

Re: [C++-sig] Accessing Class Member Function from Python

2012-06-06 Thread Nagaraju
Hi Nat, Thank you very much for the reply. I tried making the target as ".pyd" and I am able to import it in Python script. Thanks again. Regards, Raju. On Wed, Jun 6, 2012 at 6:57 PM, Nat Linden wrote: > On Wed, Jun 6, 2012 at 6:57 AM, Nagaraju > wrote: > > > Thank you very much for your rep

Re: [C++-sig] Accessing Class Member Function from Python

2012-06-06 Thread Nat Linden
On Wed, Jun 6, 2012 at 6:57 AM, Nagaraju wrote: > Thank you very much for your reply. I am sorry if I did not explain > something clearly. > > I am doing as below after implementing the MyClass in the same file: > > BOOST_PYTHON_MODULE(hello){ > ... > } > > I am using CDLL from ctypes to load thi

Re: [C++-sig] Accessing Class Member Function from Python

2012-06-06 Thread Nagaraju
Hi Nat, Thank you very much for your reply. I am sorry if I did not explain something clearly. The output file I am generating is as Test.DLL only. I am not generating it as .pyd. This DLL has a class called MyClass. In it, I have add, sub, mul n div. I am doing as below after implementing the

Re: [C++-sig] Accessing Class Member Function from Python

2012-06-06 Thread Nat Linden
On Wed, Jun 6, 2012 at 5:09 AM, Nagaraju wrote: > I wrote a wrapper class in the same file as BOOST_PYTHON_MODULE(hello). > > Now when I compiled this DLL, I get Test.DLL. Hmm, the module thinks its name is "hello", but it's in Test.DLL? Maybe it should be hello.pyd? The .pyd is to designate it