Movatterモバイル変換
[0]
ホーム
URL:
画像なし
夜間モード
Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
Submit search
EN
Uploaded by
fate_fox
PPTX, PDF
3,454 views
Boost.python
Technology
◦
Read more
3
Save
Share
Embed
Embed presentation
Download
Download to read offline
1
/ 39
2
/ 39
3
/ 39
4
/ 39
5
/ 39
6
/ 39
7
/ 39
8
/ 39
9
/ 39
10
/ 39
11
/ 39
12
/ 39
13
/ 39
14
/ 39
15
/ 39
16
/ 39
17
/ 39
18
/ 39
19
/ 39
20
/ 39
21
/ 39
22
/ 39
23
/ 39
24
/ 39
25
/ 39
26
/ 39
27
/ 39
28
/ 39
29
/ 39
30
/ 39
31
/ 39
32
/ 39
33
/ 39
34
/ 39
35
/ 39
36
/ 39
37
/ 39
38
/ 39
39
/ 39
Recommended
PDF
Wrapping a C++ library with Cython
by
fuzzysphere
PDF
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
by
kiki utagawa
PDF
NumPyが物足りない人へのCython入門
by
Shiqiao Du
PDF
Cython intro prelerease
by
Shiqiao Du
PPTX
Polyphony IO まとめ
by
ryos36
PDF
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
by
Kosaku Ono
PDF
20170131 python3 6 PEP526
by
masahitojp
PDF
Cython ことはじめ
by
gion_XY
PDF
Pythonと型チェッカー
by
Tetsuya Morimoto
PPTX
2017/12/21 虎の穴 Python勉強会
by
虎の穴 開発室
PDF
Python パッケージの影響を歴史から理解してみよう!
by
Kir Chou
PDF
Boost tour 1.60.0 merge
by
Akira Takahashi
PDF
C++14 Overview
by
Akira Takahashi
PDF
PEP8を読んでみよう
by
2bo 2bo
PPTX
Polyphony の並列化
by
ryos36
PDF
Python入門
by
Shohei Okada
PDF
L-1グランプリ "D言語"
by
det coder
PDF
Python 機械学習プログラミング データ分析ライブラリー解説編
by
Etsuji Nakai
PDF
D言語にまだ入っていない新機能 (Dの日#2)
by
tom-tan
ODP
Introduction of Python
by
Tomoya Nakayama
PDF
C#勉強会
by
hakugakucafe
PPTX
数値計算のための Python + FPGA
by
ryos36
PPTX
Apilecture for 2014/02/22 at shannonlab
by
Yutaka Kobayshi
PDF
boost tour 1.48.0 all
by
Akira Takahashi
PDF
LLdeade Python Language Update
by
Atsushi Shibata
PDF
PyCon JP 2014 plone terada
by
Manabu Terada
PPTX
Boost.python
by
fate_fox
PPTX
Boost.Python: C++ and Python Integration
by
GlobalLogic Ukraine
PDF
Interfacing C/C++ and Python with SWIG
by
David Beazley (Dabeaz LLC)
PDF
Boost.Python - domesticating the snake
by
Sławomir Zborowski
More Related Content
PDF
Wrapping a C++ library with Cython
by
fuzzysphere
PDF
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
by
kiki utagawa
PDF
NumPyが物足りない人へのCython入門
by
Shiqiao Du
PDF
Cython intro prelerease
by
Shiqiao Du
PPTX
Polyphony IO まとめ
by
ryos36
PDF
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
by
Kosaku Ono
PDF
20170131 python3 6 PEP526
by
masahitojp
PDF
Cython ことはじめ
by
gion_XY
Wrapping a C++ library with Cython
by
fuzzysphere
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
by
kiki utagawa
NumPyが物足りない人へのCython入門
by
Shiqiao Du
Cython intro prelerease
by
Shiqiao Du
Polyphony IO まとめ
by
ryos36
PyCon2020 Pythonで競プロをしよう! 〜入門者が知っておくべき高速化Tips〜
by
Kosaku Ono
20170131 python3 6 PEP526
by
masahitojp
Cython ことはじめ
by
gion_XY
What's hot
PDF
Pythonと型チェッカー
by
Tetsuya Morimoto
PPTX
2017/12/21 虎の穴 Python勉強会
by
虎の穴 開発室
PDF
Python パッケージの影響を歴史から理解してみよう!
by
Kir Chou
PDF
Boost tour 1.60.0 merge
by
Akira Takahashi
PDF
C++14 Overview
by
Akira Takahashi
PDF
PEP8を読んでみよう
by
2bo 2bo
PPTX
Polyphony の並列化
by
ryos36
PDF
Python入門
by
Shohei Okada
PDF
L-1グランプリ "D言語"
by
det coder
PDF
Python 機械学習プログラミング データ分析ライブラリー解説編
by
Etsuji Nakai
PDF
D言語にまだ入っていない新機能 (Dの日#2)
by
tom-tan
ODP
Introduction of Python
by
Tomoya Nakayama
PDF
C#勉強会
by
hakugakucafe
PPTX
数値計算のための Python + FPGA
by
ryos36
PPTX
Apilecture for 2014/02/22 at shannonlab
by
Yutaka Kobayshi
PDF
boost tour 1.48.0 all
by
Akira Takahashi
PDF
LLdeade Python Language Update
by
Atsushi Shibata
PDF
PyCon JP 2014 plone terada
by
Manabu Terada
Pythonと型チェッカー
by
Tetsuya Morimoto
2017/12/21 虎の穴 Python勉強会
by
虎の穴 開発室
Python パッケージの影響を歴史から理解してみよう!
by
Kir Chou
Boost tour 1.60.0 merge
by
Akira Takahashi
C++14 Overview
by
Akira Takahashi
PEP8を読んでみよう
by
2bo 2bo
Polyphony の並列化
by
ryos36
Python入門
by
Shohei Okada
L-1グランプリ "D言語"
by
det coder
Python 機械学習プログラミング データ分析ライブラリー解説編
by
Etsuji Nakai
D言語にまだ入っていない新機能 (Dの日#2)
by
tom-tan
Introduction of Python
by
Tomoya Nakayama
C#勉強会
by
hakugakucafe
数値計算のための Python + FPGA
by
ryos36
Apilecture for 2014/02/22 at shannonlab
by
Yutaka Kobayshi
boost tour 1.48.0 all
by
Akira Takahashi
LLdeade Python Language Update
by
Atsushi Shibata
PyCon JP 2014 plone terada
by
Manabu Terada
Viewers also liked
PPTX
Boost.python
by
fate_fox
PPTX
Boost.Python: C++ and Python Integration
by
GlobalLogic Ukraine
PDF
Interfacing C/C++ and Python with SWIG
by
David Beazley (Dabeaz LLC)
PDF
Boost.Python - domesticating the snake
by
Sławomir Zborowski
PPTX
MS COCO Dataset Introduction
by
Shinagawa Seitaro
PPS
Example Projectile Motion
by
Vidyacenter
PDF
Windows で動かす TensorFlow
by
Takeshi Osoekawa
Boost.python
by
fate_fox
Boost.Python: C++ and Python Integration
by
GlobalLogic Ukraine
Interfacing C/C++ and Python with SWIG
by
David Beazley (Dabeaz LLC)
Boost.Python - domesticating the snake
by
Sławomir Zborowski
MS COCO Dataset Introduction
by
Shinagawa Seitaro
Example Projectile Motion
by
Vidyacenter
Windows で動かす TensorFlow
by
Takeshi Osoekawa
Similar to Boost.python
KEY
ひのきのぼうだけで全クリ目指す
by
AromaBlack
PDF
Python physicalcomputing
by
Noboru Irieda
PDF
Introduction to Numpy (and Python) [JPN]
by
MasaruOinaga
PPTX
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
by
tomitomi3 tomitomi3
PDF
Boost.Flyweight
by
gintenlabo
PDF
次世代言語 Python による PyPy を使った次世代の処理系開発
by
shoma h
PDF
Python & PyConJP 2014 Report
by
gree_tech
PDF
「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12
by
Takanori Suzuki
PDF
「Python言語」はじめの一歩 / First step of Python
by
Takanori Suzuki
PDF
Pyconjp2014_implementations
by
masahitojp
PDF
Python Kyoto study
by
Naoya Inada
PDF
Introduction Pycon2010
by
(shibao)芝尾 (kouichiro)幸一郎
PDF
Pythonで始めるDropboxAPI
by
Daisuke Igarashi
PDF
Boost tour 1_40_0
by
Akira Takahashi
PPT
Python languageupdate (2004)
by
泰 増田
PDF
PyPy 紹介
by
shoma h
KEY
Hello World Python featuring GAE
by
Maito Kuwahara
PPTX
Wacode5thでのpython講義資料
by
丈 宮本
DOCX
Boost勉強会 #10 ディスカッションまとめ
by
Sigureya
KEY
Pythonについて
by
Kenji NAKAGAKI
ひのきのぼうだけで全クリ目指す
by
AromaBlack
Python physicalcomputing
by
Noboru Irieda
Introduction to Numpy (and Python) [JPN]
by
MasaruOinaga
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
by
tomitomi3 tomitomi3
Boost.Flyweight
by
gintenlabo
次世代言語 Python による PyPy を使った次世代の処理系開発
by
shoma h
Python & PyConJP 2014 Report
by
gree_tech
「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12
by
Takanori Suzuki
「Python言語」はじめの一歩 / First step of Python
by
Takanori Suzuki
Pyconjp2014_implementations
by
masahitojp
Python Kyoto study
by
Naoya Inada
Introduction Pycon2010
by
(shibao)芝尾 (kouichiro)幸一郎
Pythonで始めるDropboxAPI
by
Daisuke Igarashi
Boost tour 1_40_0
by
Akira Takahashi
Python languageupdate (2004)
by
泰 増田
PyPy 紹介
by
shoma h
Hello World Python featuring GAE
by
Maito Kuwahara
Wacode5thでのpython講義資料
by
丈 宮本
Boost勉強会 #10 ディスカッションまとめ
by
Sigureya
Pythonについて
by
Kenji NAKAGAKI
Boost.python
1.
Boost.Pythonの有能性
3.
目次自己紹介PythonについてPythonとはBoost::Pythonの使い方C++からPythonへPythonからC++へBoost::Pythonの有能性まとめ
4.
自己紹介Twitter ID: fate_fox本名:安江
直樹職業:高校3年生主な言語:C ,C++ , Python etc… 興味がある分野:自然言語処理,人工知能,グリッドコンピューティング,クラウド,並列処理 etc….
5.
今回の発表を提案してくださったのは、Bleis氏デス!このアイコン⇒
6.
Pythonについて
7.
Pythonとはなにか
8.
撫子
9.
というのは私の妄想です。
10.
正しくはこちら ⇛
11.
Pythonの歴史Python(パイソン)は、オランダ人のグイド・ヴァンロッサムが作ったオープンソースのプログラミング言語。オブジェクト指向スクリプト言語の一種であり、Perlとともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。Pythonは英語で爬虫類のニシキヘビの意味で、Python言語のマスコットやアイコンとして使われることがある。Pythonは汎用の高水準言語である。プログラマの生産性とコードの信頼性を重視して設計されており、核となるシンタックスおよびセマンティクスは必要最小限に抑えられている反面、利便性の高い大規模な標準ライブラリを備えている。Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。
多くのプラットフォームをサポートしており(動作するプラットフォーム)、また、豊富なドキュメント、豊富なライブラリがあることから、産業界でも利用が増えつつある。….
12.
By Wiki
13.
要点を纏めると
14.
Pythonを知らない人のためにPythonは覚えやすく使いやすい!覚えやすいように文法がシンプル!曖昧さをなくすためにインデントなどにうるさい!豊富なライブラリやモジュールで機能を拡張できる!Guidovan Rossum氏が開発したインタプリタ言語!ソースが読みやすい!他言語より予約語(31語)が少ない!「Python2.6より」
15.
Pythonで有名な物Google App EnginenGoogleが提供するWebアプリケーション開発環境XenPythonが使われた1台で複数台のOSが稼働できる有名な仮想ソフトウェア(OCamlも使われてるらしい さすが関数型帝国!)MAYACGを作るアプリケーション 機能などの拡張にPythonを使用Zope/PloneWebアプリケーション鯖 Pythonで書かれてます。DjangoWebフレームワーク Zopeと似てる
16.
それでは本題
17.
Boost::Pythonの使い方
18.
Boost::Pythonを使うには自分の環境では、 Boost-1.42.0 を利用してます。言い訳:1.46.0などでやろうとしたんですが、Boost自体がうまくビルドが、 できないのかわからないんですが 全然利用できなくて 1.42.0あたりが安定してる模様なのでお勧め(最新バージョンが一番いいんですがね)色々と言い訳を連ねたいですがこれ以上続けると ⇛
20.
と,“なのは”さんからSLBあたりをブッパされそうな気がするのd(ry
21.
はじめに
22.
C++からPythonへC++で書かれた関数やクラスの資源をPythonの資源として利用するために、拡張モジュールとして、コンパイルする方法。
23.
C++でBoost.Pythonをincludeする。C++で関数やクラスを書く。マクロを使ってその関数やクラスをラッピングする。コンパイルする(私はVCのコンパイラでコンパイルしました(真っ黒い画面で)).pydっていう未知の生命体が出てくる。その未知の生命体をC:\python27\DLLs に投下インタラクティブシェルを起動Import 利用できた!
24.
実践
25.
// sample1.cpp //関数のラッピング#define BOOST_PYTHON_STATIC_LIB
// Boost.Pythonライブラリを静的にリンクする#include <string>#include <boost/python.hpp>std::string hello_world(void){return "Hellow, world!";}BOOST_PYTHON_MODULE(sample1) // sample1はpython拡張Moduleの名前になる{// C++のhello_world関数を、" hello_world_python"という名前でPythonに公開するboost::python::def ("hello_world_python", &hello_world);}
26.
Python 2.7.1 (r271:86832,
Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import sample1>>> dir (sample1)['__doc__', '__file__', '__name__', '__package__', 'hello_world_python']>>> sample1.hello_world_python<Boost.Python.function object at 0x00E43990>>>> sample1.hello_world_python()'Hellow, world!'>>> print sample1.hello_world_python()Hellow, world!>>>
27.
// sample2.cpp
//クラスのラッピング#define BOOST_PYTHON_STATIC_LIB / / Boost.Pythonライブラリを静的にリンクする #include <boost/python.hpp> structCValue{ intgetValue(void) const { return value; } void setValue(int value) { this->value = value; } int value; }; BOOST_PYTHON_MODULE(sample2) // sample2はpython拡張モジュールの名前になる { // C++のCValueクラス(構造体)を、”PValue”という名前で pythonに公開する boost::python::class_<CValue>("PValue") .def(“get”, &CValue::getValue) ; // getValueメンバ関数を、”get”という名前のメソッド として公開する .def("set", &CValue::setValue); // setValueメンバ関数を、”set”という名前のメソッド として公開する }
28.
// sample3.cpp
//C++のアクセサをPythonのプロパティに公開#define BOOST_PYTHON_STATIC_LIB // Boost.Pythonライブラリを静的にリンクする #include <boost/python.hpp> structCValue{ intgetValue(void) const { return value; } void setValue(int value) { this->value = value; } int value; }; BOOST_PYTHON_MODULE(sample3) // sample3は python拡張モジュールの名前になる { // C++のCValueクラス(構造体)を、”PValue”という名前で pythonに公開する boost::python::class_<CValue>("PValue") //“value”プロパティは読み書き可 .add_property("value", &CValue::getValue, &CValue::setValue) //“rvalue”プロパティは読み取り専用 .add_property("rvalue", &CValue::getValue); }
29.
PythonからC++へPythonのコード資源を直接C++のコード資源に投げ込みます。詳細的には実践で説明します。
30.
実 践
31.
// sample4.cpp
//C++上でPythonインタプリタの実行#define BOOST_PYTHON_STATIC_LIB // Boost.Pythonライブラリを静的にリンクする #include <iostream> #include <boost/python.hpp> void c_plus_plus(void) { std::cout << "C++" << std::endl; } int main() { // Pythonインタプリタを初期化する Py_Initialize(); // "__main__"モジュールをインポートする boost::python::object module = boost::python::import("__main__"); // "__main__"モジュールの名前空間でコードを実行する boost::python::object ns = module.attr("__dict__"); // "cpp"という名前で Pythonのインタプリタから呼び出す ns["cpp"] = &c_plus_plus; // Pythonのインタプリタを実行する boost::python::exec( "print('Hello, World!')\n" "cpp() \n" "value=2**20\n" , ns); // "__main__"モジュールの名前空間で定義した変数の値を取り出す int v = boost::python::extract<int>(ns["value"]); std::cout << v << std::endl; // Pythonインタプリタの終了処理を行う Py_Finalize(); }
32.
Boost::Pythonの有能性
33.
C++から見たメリットC++で書かれた関数やクラスの資源をラッピングできる。拡張モジュールとしてファイルを出力できる。そのままPythonにimportできるから、Pythonへの実装が容易
34.
Pythonから見たメリットC++のコードにそのままPythonのコードを書ける。C++上でPythonインタプリタが実行出来る。
35.
要点を 纏めると(2回目)
36.
とても実用的!!⇑みんなの願望と夢
37.
ということで
38.
僕と契約してBoost.Pythonerになってよ!
39.
ご清聴ありがとうございました!
Download
[8]
ページ先頭
©2009-2025
Movatter.jp