Advertisement
Guest User

Untitled

a guest
Jun 13th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $ cat example.cc
  2. #include <cstdio>
  3. #include <boost/python.hpp>
  4.  
  5. void foo() {
  6. printf("can I go home now?\n");
  7. }
  8.  
  9. BOOST_PYTHON_MODULE(example)
  10. {
  11. boost::python::def("foo", foo);
  12. }
  13. $ g++ -I/usr/include/python2.6 -shared -o example.so example.cc -lboost_python
  14. $ python -c 'import example; example.foo()'
  15. can I go home now?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement