• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

C++ & Python

  • Thread starter Thread starter ExSan
  • Start date Start date
Joined
3/21/08
Messages
593
Points
38
No doubt Python is a great language, still it is too slow IMO. However I want to keep on with both of them in my project.
How to call Python library/funtions from C/C++ code?
Can someone help me with the right information. I am using Microsoft Visual Studio 2019
I know that before posting a naive question here I should have googled and I did indeed, however the vast information it provides I find difficult to solve this problem. Has anyone dealt already with this ?
 
Last edited:
Cython is good as well. It is not the only one.

be sure

1. Call C++ from Python
2. Call Python from C++ (why? just asking)
 
How are you currrently acessing python function in c++ currently. If you are currently developing a new project then your best bet is to use cython instead of the boost python module. Dont reinvent something that has been done before. Cython - Wikipedia
Why do think that Cython is 'better' than Boost-Python?
 
C++ 17 Spaceship 3-way operator <==> serves the same purpose as Python's functools.total_ordering.
 
Last edited:
Coming up in our new book: Python AND C++ interop

there's more where that came from ;)

It's the future :-)
 

Attachments

Back
Top