GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

#include #include namespace py=pybind11; PYBIND11_EMBEDDED_MODULE(fast_calc, m){ m.def("add", [](int i, int j){ return i+j; }); } int main(){ py::scoped_interpreter guard{}; // import python module py::module m = py::module::import("human"); // Human is a python class py::object Human = m.attr("Human"); // create a Human instance named jack py::object jack = Human("Jack"); // call jack's methods jack.attr("set_age")(18); py::print(jack.attr("get_name")(),"'s age:", jack.attr("get_age")()); // automatic type convertion of python's generic types auto fast_calc = py::module::import("fast_calc"); auto result = fast_calc.attr("add")(1,2).cast(); if (result == 3){ std::cout<
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.