[C++-sig] Expose c++ class as python module

Simon W simwarg at gmail.com
Tue Nov 9 21:31:26 CET 2010

I want to export my c++ class and make an instance of it and then expose it
to python as if it were a python module. Is it possible?

// export and create instance
class_<myClass> [...];

namespace["instance"] = ptr( instanceOfMyClass );

Then in python:

import instance


Thank you! /Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20101109/3ba0837f/attachment.html>

More information about the Cplusplus-sig mailing list