File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,9 +47,12 @@ PYBIND11_MODULE(pydemo, m)
4747 m.def (" info" ,
4848 []()
4949 {
50- cout << " c++ version = " << __cplusplus << endl;
51- cout << " gcc version = " << __VERSION__ << endl;
52- cout << " libstdc++ = " << __GLIBCXX__ << endl;
50+ // cout << "c++ version = " << __cplusplus << endl;
51+ // cout << "gcc version = " << __VERSION__ << endl;
52+ // cout << "libstdc++ = " << __GLIBCXX__ << endl;
53+ py::print (" c++ version =" , __cplusplus);
54+ py::print (" gcc version =" , __VERSION__);
55+ py::print (" libstdc++ =" , __GLIBCXX__);
5356 }
5457 );
5558
@@ -63,7 +66,8 @@ PYBIND11_MODULE(pydemo, m)
6366 m.def (" use_str" ,
6467 [](const string& str)
6568 {
66- cout << str << endl;
69+ // cout << str << endl;
70+ py::print (str);
6771 return str + " !!" ;
6872 }
6973 );
@@ -84,10 +88,11 @@ PYBIND11_MODULE(pydemo, m)
8488 {
8589 auto vv = v;
8690
87- for (auto & x : vv) {
88- cout << x << " ," ;
89- }
90- cout << endl;
91+ // for(auto& x : vv) {
92+ // //cout << x << ",";
93+ // }
94+ // cout << endl;
95+ py::print (" input :" , vv);
9196
9297 vv.push_back (100 );
9398
You can’t perform that action at this time.
0 commit comments