{"id":168083,"date":"2013-02-03T16:27:03","date_gmt":"2013-02-03T12:27:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=168083"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=168083","title":{"rendered":"<span class=\"post_title\">\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044f C++ \u0438 Python. \u0422\u043e\u043d\u043a\u043e\u0441\u0442\u0438 Boost.Python. \u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \tBoost.Python \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0441\u0432\u043e\u0451 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 5+, \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0421++ \u0434\u043b\u044f Python \u043b\u0438\u0431\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0443\u044e \u043e\u0431\u0432\u044f\u0437\u043a\u0443 \u043d\u0430 Python \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0421++.<br \/>  \u0421\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0432 Boost.Python \u2014 \u044d\u0442\u043e \u043e\u0431\u0438\u043b\u0438\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438 C++ \u0438 Python \u2014 \u0434\u0432\u0430 \u044f\u0437\u044b\u043a\u0430 \u0438\u0437\u043e\u0431\u0438\u043b\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u0442\u044b\u043a\u0435 \u0438\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u044e\u0430\u043d\u0441\u044b: \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u043b\u0438 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u043e\u0442\u0434\u0430\u0442\u044c \u0432 Python \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0442\u0438\u043f Python \u0438\u043b\u0438 \u0432 \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 C++, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 C++, \u043d\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0432 Python \u043c\u0435\u0442\u043e\u0434\u044b.<br \/>  \u041d\u0435 \u043e\u0431\u0435\u0449\u0430\u044e, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043e\u043f\u0438\u0448\u0443 \u0432\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0430\u0441\u0442\u043e\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043d\u0435 \u043b\u0430\u0437\u0438\u043b\u0438 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u0435\u043b\u043e\u0447\u044c\u044e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0430 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0437\u0434\u0435\u0441\u044c, \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e \u043d\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0418\u0441\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438-\u043b\u0438\u043d\u043a\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C++, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Python.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"http:\/\/www.boost.org\/users\/download\/\">Boost<\/a>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0451, \u0441\u043b\u0435\u0434\u0443\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u041e\u0421 <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/more\/getting_started\/windows.html\">Windows<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/more\/getting_started\/unix-variants.html\">Linux<\/a>.<br \/>  \u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u0432 Windows \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0434\u0432\u0443\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 Boost \u0432 \u043b\u044e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0442\u0443\u0434\u0430 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0432\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">bootstrap b2 --build-type=complete stage <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 x64 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <b>address-model=64<\/b><br \/>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Boost, \u043d\u043e \u0432\u044b \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0438 Python, \u043b\u0438\u0431\u043e \u0432\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0441\u0432\u0435\u0436\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Python \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e Boost.Python, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c <b>&#8212;with-python<\/b><br \/>  \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e Boost.Python \u0441 64-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">b2 --build-type=complete address-model=64 --with-python stage <\/code><\/pre>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e x64 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python x64. \u0422\u0430\u043a\u0436\u0435 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441 64-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0435\u0439.<br \/>  \u041a\u043b\u044e\u0447 <b>&#8212;with-python<\/b> \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0430\u043c \u0432\u0440\u0435\u043c\u044f, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Boost \u043a\u0440\u043e\u043c\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 Boost.Python \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<br \/>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u0432, \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/libs\/python\/doc\/building.html\">Boost.Python<\/a><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Boost\\stage\\lib \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Boost.Python, \u043e\u043d\u0438 \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 C++<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438-\u043b\u0438\u043d\u043a\u0443\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 C++, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e example.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 INCLUDE \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 <u>Python\\include<\/u> \u0438 \u043a\u043e\u0440\u0435\u043d\u044c <u>Boost<\/u>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a <u>Python\\libs<\/u> \u0438 <u>Boost\\stage\\lib<\/u><br \/>  \u041f\u043e\u0434 Windows \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Post-build events \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 $(TargetPath) \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c example.pyd \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <br \/>  \u0422\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Boost.Python \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c.<br \/>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0441\u0432\u0435\u0434\u0451\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435:  <\/p>\n<pre><code class=\"python\">from example import * <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u043e\u0434 x64 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u0434\u043b\u044f 64-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0433\u043e Python.<\/p>\n<h4>\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0432\u0435\u0434\u0451\u043c \u043d\u0430\u0448\u0435\u043c \u043d\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430:<br \/>  some.h<br \/>  some.cpp<br \/>  wrap.cpp<\/p>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0430\u0445 some.h \u0438 some.cpp \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u043a\u0438\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Some, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0434\u043b\u044f Python \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 example \u0432 \u0444\u0430\u0439\u043b\u0435 wrap.cpp \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 wrap.cpp \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c &lt;boost\/python.hpp&gt; \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 BOOST_PYTHON_MODULE( example ) {\u2026 }, \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043b\u0438\u0448\u043d\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c using namespace boost::python. \u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u0448 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">#include &lt;boost\/python.hpp&gt; ...  using namespace boost::python; ...  BOOST_PYTHON_MODULE( example ) {     ... } ... <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 some.h \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u0432\u0430\u044f\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0447\u0443\u0434\u043e-\u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043f\u043e\u043b\u044f:  <\/p>\n<pre><code class=\"cpp\">private:     int mID;     string mName; <\/code><\/pre>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0447\u0435\u0433\u043e-\u0442\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0438\u043c\u044f \u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. \u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043a\u0443\u0447\u0443 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 string, \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 NOT_AN_IDENTIFIER, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0442\u043e\u0436\u0435 \u0432\u0432\u0435\u0434\u0451\u043c:  <\/p>\n<pre><code class=\"cpp\">public:     static const int NOT_AN_IDENTIFIER = -1; <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u043d\u0443\u0436\u043d\u0430 \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043e\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f:  <\/p>\n<pre><code class=\"cpp\">    Some();     Some( int some_id, string const& name ); <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 some.cpp \u043e\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u0435:  <\/p>\n<pre><code class=\"cpp\">Some::Some()     : mID(NOT_AN_IDENTIFIER) { }  Some::Some( int some_id, string const& name )     : mID(some_id), mName(name) { } <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430 Some \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f Python \u0432 \u0444\u0430\u0439\u043b\u0435 wrap.cpp:  <\/p>\n<pre><code class=\"cpp\">BOOST_PYTHON_MODULE( example ) {     class_&lt;Some&gt;( &quot;Some&quot; )         .def( init&lt;int,string&gt;( args( &quot;some_id&quot;, &quot;name&quot; ) ) )     ; } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u0441\u043e\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043e\u0431\u043c\u0430\u043d \u0437\u0440\u0435\u043d\u0438\u044f \u0438 \u0448\u0430\u0431\u043b\u043e\u043d boost::python::class_, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f Python \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python C-API, \u0436\u0443\u0442\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043f\u0440\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0437\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 def() \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435.<br \/>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435, \u043d\u043e \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0451 \u043a\u043e\u0441\u043d\u0451\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435.<br \/>  \u0423\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python \u0438 \u0434\u0430\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u043e \u043d\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u044b \u0443 \u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0431\u043e\u0433\u0430\u0442\u0435\u0439\u0448\u0435\u0435\u00bb API \u043d\u0430\u0448\u0435\u0433\u043e \u0447\u0443\u0434\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 some.h:  <\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;string&gt;  using std::string;  class Some { public:     static const int NOT_AN_IDENTIFIER = -1;      Some();     Some( int some_id, string const& name );      int ID() const;     string const& Name() const;      void ResetID();     void ResetID( int some_id );      void ChangeName( string const& name );      void SomeChanges( int some_id, string const& name );  private:     int mID;     string mName; }; <\/code><\/pre>\n<p>  \u0420\u0430\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438 \u043a\u043e\u0434 some.cpp:  <\/p>\n<pre><code class=\"cpp\">#include &quot;some.h&quot;  Some::Some()     : mID(NOT_AN_IDENTIFIER) { }  Some::Some( int some_id, string const& name )     : mID(some_id), mName(name) { }  int Some::ID() const {      return mID; }  string const& Some::Name() const {     return mName; }  void Some::ResetID() {     mID = NOT_AN_IDENTIFIER; }  void Some::ResetID( int some_id ) {     mID = some_id; }  void Some::ChangeName( string const& name ) {     mName = name; }  void Some::SomeChanges( int some_id, string const& name ) {     mID = some_id;     mName = name; } <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0436, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b\u0435 wrap.cpp:<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 Some::ID() \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:  <\/p>\n<pre><code class=\"cpp\">        .def( &quot;ID&quot;, &Some::ID ) <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0443\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e:  <\/p>\n<pre><code class=\"cpp\">        .def( &quot;Name&quot;, &Some::Name, return_value_policy&lt;copy_const_reference&gt;() ) <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a Python \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432 C++ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0432\u0435\u0440\u0441\u043a\u0438\u0439 Garbage Collector (GC) \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u0438\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u0441\u0451 \u0431\u0435\u0441\u0445\u043e\u0437\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443, \u0432\u0430\u043c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0434\u0430\u0441\u0442, \u0432\u0441\u0451 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 GC \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u0435\u043c\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0430\u0447\u043d\u0451\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 C++. \u0412\u0441\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 <a href=\"http:\/\/wiki.python.org\/moin\/boost.python\/CallPolicy\">return_value_policy \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/a>, \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:  <\/p>\n<ul>\n<li><b>copy_non_const_reference<\/b> \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <b>\u043d\u0435<\/b>\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 C++, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 C++ (\u043f\u0440\u0438\u043c\u0435\u0440: string \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0431\u0451\u0440\u0442\u043a\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u0432 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 str)<\/li>\n<li><b>copy_const_reference<\/b> \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 C++, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 C++ (\u043f\u0440\u0438\u043c\u0435\u0440: \u0442\u043e\u0442 \u0436\u0435 string)<\/li>\n<li><b>manage_new_object<\/b> \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 C++, \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f<\/li>\n<li><b>reference_existing_object<\/b> \u2014 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 C++, \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 return_value_policy \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u044d\u043a\u0441\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435, \u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435, \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0431\u0438\u0432\u0430\u0439\u0442\u0435 \u0440\u0443\u043a\u0443. \u0414\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e string \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 <b>copy_const_reference<\/b> \u043b\u0438\u0431\u043e <b>copy_non_const_reference<\/b>, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0442.\u043a. string \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Python \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <b>str<\/b>, \u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c <b>return_value_policy<\/b>.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 Some::ResetID \u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u043b, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 \u0432 .def():  <\/p>\n<pre><code class=\"cpp\">        .def( &quot;ResetID&quot;, static_cast&lt; void (Some::*)() &gt;( &Some::ResetID ) )         .def( &quot;ResetID&quot;, static_cast&lt; void (Some::*)(int) &gt;( &Some::ResetID ), args( &quot;some_id&quot; ) ) <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0441 \u043a\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0432 Python \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0438\u043c\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 Python \u043a\u0443\u0434\u0430 \u0432\u0430\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u0432 C++. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:  <\/p>\n<pre><code class=\"cpp\">        .def( &quot;ChangeName&quot;, &Some::ChangeName, args( &quot;name&quot; ) )         .def( &quot;SomeChanges&quot;, &Some::SomeChanges, args( &quot;some_id&quot;, &quot;name&quot; ) ) <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 NOT_AN_IDENTIFIER:  <\/p>\n<pre><code class=\"cpp\">        .add_static_property( &quot;NOT_AN_IDENTIFIER&quot;, make_getter( &Some::NOT_AN_IDENTIFIER ) ) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f boost::python::make_getter, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 get-\u0444\u0443\u043d\u043a\u0446\u0438\u044e.<br \/>  \u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448\u0430 \u043e\u0431\u0451\u0440\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"cpp\">#include &lt;boost\/python.hpp&gt; #include &quot;some.h&quot;  using namespace boost::python;  BOOST_PYTHON_MODULE( example ) {     class_&lt;Some&gt;( &quot;Some&quot; )         .def( init&lt;int,string&gt;( args( &quot;some_id&quot;, &quot;name&quot; ) ) )         .def( &quot;ID&quot;, &Some::ID )         .def( &quot;Name&quot;, &Some::Name, return_value_policy&lt;copy_const_reference&gt;() )         .def( &quot;ResetID&quot;, static_cast&lt; void (Some::*)() &gt;( &Some::ResetID ) )         .def( &quot;ResetID&quot;, static_cast&lt; void (Some::*)(int) &gt;( &Some::ResetID ), args( &quot;some_id&quot; ) )         .def( &quot;ChangeName&quot;, &Some::ChangeName, args( &quot;name&quot; ) )         .def( &quot;SomeChanges&quot;, &Some::SomeChanges, args( &quot;some_id&quot;, &quot;name&quot; ) )         .add_static_property( &quot;NOT_AN_IDENTIFIER&quot;, make_getter( &Some::NOT_AN_IDENTIFIER ) )     ; } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e (Python 3.x):  <\/p>\n<pre><code class=\"python\">from example import * s = Some()  print( &quot;s = Some(); ID: {ID}, Name: {Name}&quot;.format(ID=s.ID(),Name=s.Name()) ) s = Some(123,'asd') print( &quot;s = Some(123,'asd'); ID: {ID}, Name: {Name}&quot;.format(ID=s.ID(),Name=s.Name()) ) s.ResetID(234); print(&quot;s.ResetID(234); ID:&quot;,s.ID()) s.ResetID(); print(&quot;s.ResetID(); ID:&quot;,s.ID()) s.ChangeName('qwe'); print(&quot;s.ChangeName('qwe'); Name:'%s'&quot; % s.Name()) s.SomeChanges(345,'zxc') print( &quot;s.SomeChanges(345,'zxc'); ID: {ID}, Name: {Name}&quot;.format(ID=s.ID(),Name=s.Name()) ) <\/code><\/pre>\n<p>  \u041c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432\u044b\u0432\u043e\u0434:  <\/p>\n<pre><code class=\"python\">s = Some(); ID: -1, Name: '' s = Some(123,'asd'); ID: 123, Name: 'asd' s.ResetID(234); ID: 234 s.ResetID(); ID: -1 s.ChangeName('qwe'); Name:'qwe' s.SomeChanges(345,'zxc'); ID: 345, Name: 'zxc' <\/code><\/pre>\n<h4>\u041f\u0438\u0442\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u0430<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043b\u0430\u0441\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0431\u0451\u0440\u043d\u0443\u0442, \u043d\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u044f \u043d\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u043e. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 Python \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 Some(123,&#8217;asd&#8217;) \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043d\u0435 \u043e\u0431\u0437\u0430\u0432\u0435\u043b\u0438\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c __repr__, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a \u0441\u0442\u0440\u043e\u043a\u0435, \u0442\u043e\u0442 \u0436\u0435 print( Some(123,&#8217;asd&#8217;) ) \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0430\u0441\u043d\u043e \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u043e\u0431\u0437\u0430\u0432\u0435\u043b\u0438\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c __str__. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430 C++ \u043d\u0430 Python \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u044d\u0442\u043e \u0432 C++ \u043c\u044b \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c property, \u0432 Python \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u0430\u043a \u0436\u0435 \u043c\u044b \u043d\u0430\u0432\u0435\u0441\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 C++ \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f Python?<br \/>  \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 Python \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 self \u2014 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430. \u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0432 C++ \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u044f\u043c\u043e \u0432\u043e wrap.cpp \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043e\u0431\u0451\u0440\u0442\u043a\u0435:  <\/p>\n<pre><code class=\"python\">... string Some_Str( Some const& ); string Some_Repr( Some const& ); ... BOOST_PYTHON_MODULE( example ) {     class_&lt;Some&gt;( &quot;Some&quot; )         ...         .def( &quot;__str__&quot;, Some_Str )         .def( &quot;__repr__&quot;, Some_Repr ) ... <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">string Some_Str( Some const& some ) {     stringstream output;     output &lt;&lt; &quot;{ ID: &quot; &lt;&lt; some.ID() &lt;&lt; &quot;, Name: '&quot; &lt;&lt; some.Name() &lt;&lt; &quot;' }&quot;;     return output.str(); }  string Some_Repr( Some const& some ) {     return &quot;Some: &quot; + Some_Str( some ); } <\/code><\/pre>\n<p>  \u0421\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u0438\u043c\u0435\u043d\u0438 \u0435\u0449\u0451 \u043f\u0440\u043e\u0449\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b set \u0438 get \u0434\u043b\u044f \u043d\u0438\u0445 \u0443\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435:  <\/p>\n<pre><code class=\"cpp\">        .add_property( &quot;some_id&quot;, &Some::ID, static_cast&lt; void (Some::*)(int) &gt;( &Some::ResetID ) )         .add_property( &quot;name&quot;, make_function( static_cast&lt; string const& (Some::*)() const &gt;( &Some::Name ), return_value_policy&lt;copy_const_reference&gt;() ), &Some::ChangeName ) <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0442\u043e\u043d\u043a\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430:<br \/>  1. \u0414\u043b\u044f set-\u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 some_id \u0431\u044b\u043b\u043e \u044f\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a \u0442\u0438\u043f\u0443 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e int, \u0442.\u043a. \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430.<br \/>  2. \u0414\u043b\u044f get-\u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 name \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f boost::python::make_function, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c return_value_policy \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 string.<\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c print( Some(123,&#8217;asd&#8217;) ) \u0438 \u043f\u0440\u043e\u0441\u0442\u043e Some(123,&#8217;asd&#8217;) \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 from example import * \u0438 \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 dict: { ID: 123, Name: &#8216;asd&#8217; }<br \/>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Some \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e dict \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e?<br \/>  \u0417\u0430\u0432\u0435\u0434\u0451\u043c \u0435\u0449\u0451 \u043f\u0430\u0440\u0443 \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0437\u0430\u0432\u0435\u0434\u0451\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e as_dict:  <\/p>\n<pre><code class=\"cpp\">... dict Some_ToDict( Some const& ); void Some_FromDict( Some&, dict const& ); ... BOOST_PYTHON_MODULE( example ) {     class_&lt;Some&gt;( &quot;Some&quot; )         ...         .add_property( &quot;as_dict&quot;, Some_ToDict, Some_FromDict )     ;     ... } ... dict Some_ToDict( Some const& some ) {     dict res;     res[&quot;ID&quot;] = some.ID();     res[&quot;Name&quot;] = some.Name();     return res; }  void Some_FromDict( Some& some, dict const& src ) {     src.has_key( &quot;ID&quot; ) ? some.ResetID( extract&lt;int&gt;( src[&quot;ID&quot;] ) ) : some.ResetID();     some.ChangeName( src.has_key( &quot;Name&quot; ) ? extract&lt;string&gt;( src[&quot;Name&quot;] ) : string() ); } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043a\u043b\u0430\u0441\u0441 boost::python::dict, \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 C++ \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 dict Python.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a str, list, tuple, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0412\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044f \u043a\u043b\u0430\u0441\u0441\u044b \u0432 C++ \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 Python \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 boost::python::object, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e boost::python::extract.<\/p>\n<h4>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/h4>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u044b\u043b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043b\u0430\u0441\u0441 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439.<br \/>  \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Boost.Python \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043b\u044e\u0431\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u043a \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 Python.<br \/>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u0442\u0440\u0435\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043e\u0431\u0435\u0440\u043d\u0451\u043c enum, \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u043c return_value_policy&lt;reference_existing_object&gt;.<br \/>  \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b \u0442\u0438\u043f\u043e\u0432 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b Python \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0431\u0435\u0437 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442. \u041d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0438\u0437 C++ \u0432 Python \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<br \/>  \u0422\u0435\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f.<\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442<\/h4>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u043b\u044f Windows \u0432\u044b\u043b\u043e\u0436\u0435\u043d <a href=\"http:\/\/www.megafileupload.com\/en\/file\/389466\/example-7z.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u041f\u0440\u043e\u0435\u043a\u0442 MSVS v11 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441 Python 3.3 x64. \u0421\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 .dll Boost.Python \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f.<br \/>  \u041d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b some.h, some.cpp, wrap.cpp \u043b\u044e\u0431\u044b\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u043c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043e\u043c \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Python.<\/p>\n<h4>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/libs\/python\/doc\/\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Boost.Python<\/a><br \/>  <a href=\"http:\/\/wiki.python.org\/moin\/boost.python\/CallPolicy\">\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 Boost.Python<\/a><br \/>  <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/more\/getting_started\/windows.html\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Boost \u0434\u043b\u044f Windows<\/a><br \/>  <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/more\/getting_started\/unix-variants.html\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Boost \u0434\u043b\u044f *nix<\/a><br \/>  <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_52_0\/libs\/python\/doc\/building.html\">\u0422\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 Boost.Python<\/a>    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/168083\/\"> http:\/\/habrahabr.ru\/post\/168083\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \tBoost.Python \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0441\u0432\u043e\u0451 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 5+, \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0421++ \u0434\u043b\u044f Python \u043b\u0438\u0431\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0443\u044e \u043e\u0431\u0432\u044f\u0437\u043a\u0443 \u043d\u0430 Python \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0421++.<br \/>  \u0421\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0432 Boost.Python \u2014 \u044d\u0442\u043e \u043e\u0431\u0438\u043b\u0438\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438 C++ \u0438 Python \u2014 \u0434\u0432\u0430 \u044f\u0437\u044b\u043a\u0430 \u0438\u0437\u043e\u0431\u0438\u043b\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u0442\u044b\u043a\u0435 \u0438\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u044e\u0430\u043d\u0441\u044b: \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u043b\u0438 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u043e\u0442\u0434\u0430\u0442\u044c \u0432 Python \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0442\u0438\u043f Python \u0438\u043b\u0438 \u0432 \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 C++, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 C++, \u043d\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0432 Python \u043c\u0435\u0442\u043e\u0434\u044b.<br \/>  \u041d\u0435 \u043e\u0431\u0435\u0449\u0430\u044e, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043e\u043f\u0438\u0448\u0443 \u0432\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0430\u0441\u0442\u043e\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043d\u0435 \u043b\u0430\u0437\u0438\u043b\u0438 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u0435\u043b\u043e\u0447\u044c\u044e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0430 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0437\u0434\u0435\u0441\u044c, \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e \u043d\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-168083","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/168083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168083"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/168083\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}