Is it possible to embed Python in a VC++/MFC application. If yes, can you please tell me how to do that.
Is it possible to embed Python in a VC++/MFC application. If yes, can you
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can embed python in any application where you can call functions from a C library. The fact that you are using MFC is not really important for this.
The official python documentation for this is pretty good:
On how to do that: basically you simply call
Py_Initialize();to initialize Python and then do whatever you want to do with it. Before your application exits it’s a good idea to callPy_Finalize();to clean up things.