On Wed, Jun 6, 2012 at 5:09 AM, Nagaraju <srirangamnagar...@gmail.com> 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 as a Python extension. Python stopped
importing plain .dlls along about Python 2.5.

> Now from Python, I wrote a script to load this Test.DLL.

As 'import Test' or as 'import hello'?

> How can I access add, sub and other functions in my Python script?

You said you wrote a wrapper class, and that the add, sub etc. are
methods on that class?

Let's say your wrapper class is called Wrapper.

import hello
obj = hello.Wrapper()  # instantiate

-- or, equivalently --

from hello import Wrapper
obj = Wrapper()

-- then, either way --

print obj.add(something, something_else)
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to