I have a simple script that runs on Selenium. I made an .exe file out of it and it works perfectly fine but there is one problem I have noticed. The .exe opens a console as intended but if I manually close the console while the script is running, it leaves firefox.exe opened in Processes tab.
My question is: how do I make Python close these processes in case if the script's execution has been interrupted manually?
I'm guessing I need to catch the exception, but what exception does Python throw in case if we manually stop the program?