Python as Watchdog for Windows
Hi I am considering using Python to create a watchdog application on Windows XP that will do the following:
- Restart Windows at a specific point in time.
- Run the exe application.
- Start timer to check if the running application is still running
I am aware of the existence of PyWin32, but I heard that the API is incomplete. So my question is, can Python do these things on Windows?
+2
source to share
1 answer
Since you only want this to work on Windows, the easiest way to do this is to use os.system and make system calls from within a Python program.
Use the built-in Windows tool to launch programs at specific times.
Use shutdown -r to restart Windows.
Use the task list to view all processes and then search that list. If you also need to manipulate the process, the best way I know is the COM method described here .
+2
source to share