Answer the question
In order to leave comments, you need to log in
Is it possible to intercept the process termination event of a python application and flush some of its data to disk?
Let's say a python command line application repeatedly gives the user text and waits for input, the results of which must be processed and stored on disk. In order to save the hard disk resource, I want to write to disk not after each input, but to accumulate 50 inputs in memory and flush to disk. Considering that users have a habit of closing cli applications with Ctrl+z or closing the terminal, how can you ensure that data is reset at the time of such an emergency close?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question