Let's call your own C ++ library with Python (Preferences)

Let's call your own C ++ library with Python (Preferences)

Overview

Regarding the title, C ++, which is my favorite language because I am free, and Python, which suddenly emerged and became 2 recommendations. I wanted to make it work together, so when I looked it up, there was a tutorial on Microsoft's official page. It is a record executed accordingly.

I want to record the points that are particularly clogged with a hard copy.

Reference page

Microsoft official page Creating C ++ Extensions for Python With reference to

Installation of Python environment

The latest (as of April 30, 2020) 64-bit version of Python was already installed on my PC. I used to go without reading the tutorial, but this was the point I was addicted to. You can rest assured that you can install the 32-bit version using the Visual Studio installer.

However, it seems that you can check where it was installed with the registry editor. Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Python \ PythonCore \ 3.7 \ PythonPath

In my case C: \ Program Files (x86) \ Microsoft Visual Studio \ Shared \ Python37_64 was. This is an environment variable PYTHONPATH Pass through.

image.png

It seems that it needs to be python3.6, which was not good even above.

https://www.python.org/downloads/release/python-361/ Install from and set the above environment path

result

You can see the overwhelming speed improvement. However, I don't think there will be an opportunity to create a process for speed at this level. The Python library is abundant, so it's unlikely to be used in practice (personally)

image.png

Recommended Posts

Let's call your own C ++ library with Python (Preferences)
Call your own C library with Go using cgo
Publish your own Python library with Homebrew
Call your own C language shared library from Python using ctypes
Call C from Python with DragonFFI
Until you can install your own Python library with pip
Run the intellisense of your own python library with VScode.
[Reinforcement learning] DQN with your own library
[Python] Register your own library on PyPI
Until you install your own Python library
Linux C / C ++ Build your own library creation environment
Make your own module quickly with setuptools (python)
Steps to install your own library with pip
Memo to create your own Box with Pepper's Python
Call your own python module from the ROS package
Programming with your smartphone anywhere! (Recommended for C / Python)
ABC163 C problem with python3
Let's run Excel with Python
Let's write python with cinema4d.
Call the API with python3.
ABC188 C problem with python3
Let's build git-cat with Python
ABC187 C problem with python
Try sorting your own objects with priority queue in Python
Solve ABC163 A ~ C with Python
[Python] Make your own LINE bot
[Python] logging in your own module
Let's make a GUI with python.
I made my own Python library
Solve your own maze with Q-learning
Call popcount from Ruby / Python / C #
Let's play with Excel with Python [Beginner]
Solve ABC168 A ~ C with Python
Let's do image scraping with Python
Solved AtCoder ABC 114 C-755 with Python3
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
[Hyperledger Iroha] Query with Python library
Call python from nim with Nimpy
Solve ABC158 A ~ C with Python
Let's make a graph with python! !!
Train UGATIT with your own dataset
Solve your own maze with DQN
Let's analyze voice with Python # 1 FFT
Call C / C ++ from Python on Mac
Call c language from python (python.h)
Use a scripting language for a comfortable C ++ life 4-Use your own C ++ library from a scripting language-
Create your own virtual camera with Python + OpenCV and apply original effects
Let's make an image recognition model with your own data and play!
How to access data with object ['key'] for your own Python class
Your own Twitter client made with Django
Create your own Linux commands in Python
Create wordcloud from your tweet with python3
[LLDB] Create your own command in Python
Easily use your own functions in Python
Create your own DNS server with Twisted
[Python] Package and distribute your own modules
Let's create a free group with Python
Create your own Composite Value with SQLAlchemy
[C] [python] Read with AquesTalk on Linux
[Introduction to Python] Let's use foreach with Python