Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat example.cc
- #include <cstdio>
- #include <boost/python.hpp>
- void foo() {
- printf("can I go home now?\n");
- }
- BOOST_PYTHON_MODULE(example)
- {
- boost::python::def("foo", foo);
- }
- $ g++ -I/usr/include/python2.6 -shared -o example.so example.cc -lboost_python
- $ python -c 'import example; example.foo()'
- can I go home now?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement