0

I'm calling python file from the c# using process.start() method. when I run my c# application python file is starting in task manager. but when I stop my application its not killing from task manager. And if I run the solution once again the new python is starting again in the task manager. And I deployed my c# application in Virtual Machine and their python file is starting in task manager. but after some time python files count are increasing in task manager. Please help me to stop the increasing number of python files from the task manager.

Tek Nath Acharya
  • 1,676
  • 2
  • 20
  • 35
shree
  • 35
  • 11
  • Are you killing the Python process when you quit your application? – ProgrammingLlama Dec 19 '19 at 08:58
  • Now I'm killing python files from the task manager. if I didn't kill those, those will be up and running. – shree Dec 19 '19 at 09:01
  • [Related question](https://stackoverflow.com/questions/22318493/does-process-start-terminate-the-child-program-when-the-parent-terminates) which might clear up your confusion. – ProgrammingLlama Dec 19 '19 at 09:04
  • If the parent app reaches its end before python script and you want to stop the python script. It's enough to remember the result of `process.start` and check it before "return call from main". If you want to catch process being terminated just try this solution from [.NET Console Application Exit Event answer](https://stackoverflow.com/questions/1119841/net-console-application-exit-event#answer-22996350) – Dice Dec 19 '19 at 09:11

0 Answers0