Which process runs python script running through python.net in C#

Viewed 112

I have the following script.

try
            {
                PythonEngine.Initialize();

            using (Py.GIL())
            {
                
                using (PyScope scope = Py.CreateScope())
                {
                    
                    string fileContent = File.ReadAllText(Path.Combine(@"../../", ScriptName));
                    var file = PythonEngine.Compile(fileContent);

                    scope.Execute(file);
                    
                }

                    
            }

When I run this script, it runs without issues but when I see the task manager I see no python process. I want to know what process is executing this script?

1 Answers

Your application's process is executing the script: Python.Net uses embedding. Which in practice when running on Windows means Python.Net is going to load e.g. python39.dll, call Py_Initialize(), and so on. Which actually is exactly the same as what the interpreter executable, python.exe, does.

Related