• 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!

Microsoft Visual Studio Community 2022

Joined
3/21/08
Messages
588
Points
38
Microsoft Visual Studio Community 2022 / Version 17.1.1

C++:
#include "stdafx.h"
#include <Python.h>
/***********START***************/
int main(){  
    PyObject* pInt;
    Py_Initialize();
    PyRun_SimpleString("print('Hello World from Embedded Python!!!')");
    Py_Finalize();  
    return 0;

}

does anyone know how to install #include <Python.h>

Properties/path/environment ?

I have already installed Python Development Environment / Python Version Version: 3.9

my aim is to call python functions from C/C++ code
 
Last edited:
1656688034539.png

I am kind of close to make it. Now I get this error (attached image), does anyone know how to fix it?
C++:
#include <iostream>
#include <Python.h>
int main(){  
    // Initialize the Python Interpreter
    Py_Initialize();
    PyRun_SimpleString("print('Hello World from Embedded Python!!!')");
    Py_Finalize();
}
 
Last edited:
Back
Top