I'm writing a C++ .dll project, which is injected into another process, and I'm trying to implement embedded Python code. As far as I have described it, this is working. For instance when I inject the .dll, I run the following code:
Py_Initialize();
FILE* PScriptFile = std::fopen("D:\\test.py", "r");
if (PScriptFile) PyRun_SimpleFile(PScriptFile, "D:\\test.py");
test.py is a simple script which opens and writes to a text file. Thus, I know that my .dll is running the script because I can see that this text file is created in the directory of the main executable. Now, I want to run the following script:
import tkinter as tk
window = tk.Tk()
window.protocol("WM_DELETE_WINDOW",window.destroy)
window.mainloop()
I know that this script works on its own. However, when I try to embed it, no Tkinter window pops up.
Thanks