I'm using C++, Python 3.5, and Windows 7. I'm currently calling a C++ executable from my Python code using subprocess, then terminating the executable using the following code:
open = Popen([path\to\exe])
open.terminate()
This seems unlikely, but is it possible for my C++ code to call a function in itself when Python calls terminate on it? I've found options for functions to be called when C++ is closed with the X button or by itself, but this question is too specific.