I have create a C++ application that use python using the python C++ library and I have temporarily change my PATH variable into C++ using this code
GetEnvironmentVariable( _T("PATH"), szSysPath.GetBuffer(32000), 32000) ;
szSysPath.ReleaseBuffer() ;
szSysPath = _T("C:\\Path1;") +
_T("C:\\Path2;") +
szSysPath ;
SetEnvironmentVariable( _T("PATH"), szSysPath );
Next, I have initialized Python using
Py_Initialize() ;
This code is OK because I can execute many script Python using my application but when I execute a script that show the PATH, my new paths added are not present.
This is my Python script
import os
print(os.environ['PATH'])
Do you have any ideas about this problem? Maybe i must update library os with new data? Thanks