Python can also be used as a scripting engine in Microsoft's Active Scripting architecture

As it is stated here: https://www.python.org/doc/essays/omg-darpa-mcc-position/

How can I do as the title says?

Currently I do this

  1. Install python-3.9.4-amd64.exe
  2. Run “pip install pywin32” in cmd
  3. Run this program and check hr after CoCreateInstance
#include <atlbase.h>
#include <activscp.h>
int _tmain(int argc, _TCHAR* argv[])
{
    HRESULT hr = S_OK;
    hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);

    GUID guid; CLSIDFromProgID(L"Python", &guid); //this does not work in CoCreateInstance (guid is valid)
    //GUID guid; CLSIDFromProgID(L"JavaScript", &guid); //this works in CoCreateInstance
    IActiveScript* script; hr = CoCreateInstance(guid, 0, CLSCTX_INPROC_SERVER, IID_IActiveScript, (void**)&script);

    ::CoUninitialize();
    return 0;
}

I think it works now.

[change the paths to your install path]
install latest python 3
get pywin32
  >pip install pywin32
start search 'environment variables', add PYTHONPATH and PYTHONHOME set both to 'D:\Program\Python3'
also edit PATH to remove duplicates (or other versions of python)
register as active script engine
  >python d:\Program\Python3>python Lib\site-packages\win32comext\axscript\client\pyscript.py