logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

23 lines
418 B

#include <pybind11/pybind11.h>
#include <pybind11/embed.h>
#include <iostream>
namespace py = pybind11;
void print(py::list l) {
for (auto item: l) {
std::cout << item.attr("__str__")().cast<std::string>() << std::endl;
}
}
int main() {
py::scoped_interpreter guard{};
py::print("Hello, World!");
py::list data;
for (int i = 0; i < 10; i++) {
data.append(i);
}
print(data);
return 0;
}