简体   繁体   中英

How to catch run termination from Eclipse pydev?

I have a python script which makes use of multiprocessing. I like to debug my scripts in Eclipse, but with multiprocessing, I always have to manually kill the spawned children processes after termination. How can I catch the Eclipse termination action in the script so it can clean up?

By catching the eclipse termination, do you mean catching the event of someone pressing the "Terminate" button while debugging? If so, I don't think there is an exception or event you can catch.

Here is a few things i tried on the side that does not work either: 1. Adding signal handlers for SIGTERM, SIGNTEAL, and SIGINT, but no luck. 2. try the atexit module, it only works only normal program termination.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM