One of my data analysis application I am using Brute force search method for finding similar patterns, the possible conditions will be millions.
For better performance all the results are store in the memory and will write into database every hours.
But now I can't stop the application in middle, So how i can give a exit command(like a command or shortcut key) to the application through command prompt, so it will write all the results into database from memory and call exit function (like sys.exit() ).
Can I accomplish this by using argparse or modules like click?. I couldn't find any examples.