Actually I am creating a reminder program for me so I want to execute that program before shutting down or hibernating my pc so is there any "module" or "OS method" in python to do so or anyway to execute my program before shutting down?
Asked
Active
Viewed 57 times
0
-
1You likely want to tackle this from the other way around. For example, you might look into what the OS can do for you to trigger your program. For example, see the answer here : https://stackoverflow.com/questions/101647/how-to-schedule-a-task-to-run-when-shutting-down-windows – JonSG Apr 17 '21 at 20:12
1 Answers
0
Instead of using Python, you should look into OS automation or scheduler operations that could help you with this.
Since no information about OS is mentioned, assuming OS is Windows, you can refer this answer to run your script before Shutdown. How to schedule a task to run when shutting down windows
This answer is old but you can take a reference from here on how to do this.

Raunak Jalan
- 83
- 7