I am working on a Python code embedding in c++ helloworld program, necessary additional include/library directories are properly set up. Now I have made it work using the answer from
python works in c++ in debug mode, but not in exe file
I hope my code works on my teamates' PC. What I did was
[1] copy folder C:/Python
to D:/Project/Python
[2] retrieve Python registry file, replace C:/Python/...
by D:/Project/Python/...
, and save a new registry file ProjPython.reg
[3] let my teamate save my project to D:/Project/Python
and run ProjPython.reg
This is clearly very stupid, I think what it needs is just telling Visual Studio the directories of Python header, interpreter, dll and so on.
Then I searched it online, finding that I could use Python Environments in Visual Studio (i.e. Python Tool Visual Studio).
After I set up Prefix Path, Interpreter Path, Windowed Interpreter to D:/Project/Python
D:/Project/Python/python.exe
D:/Project/Python/pythonw.exe
, hoping it would run successfully without editting registry, but it failed.
Anybody know how to set up Python directories in Visual Studio 2017 and later for C++ code that containing some python scripts. Gracias!