I wrote Python script that processes big number of large text files and may run a lot of time. Sometimes, there is a need to stop the running script and to resume it later. The possible reasons to stop the script are program crash, disk 'out of space' situation or many others when you have to do it. I want to implement kind of "stop/resume" mechanism for the script.
- On stop: the script quits & saves its current state.
- On resume: the script starts, but continues from the latest saved state
I'm going to implement it using the pickle and the signal modules.
I'll be glad to hear how to do it in pythonic way.
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…