BefittingTheorem
BefittingTheorem

Reputation: 10629

Python as a Windows Watchdog

Hi I'm considering using Python to make a watchdog app on Windows XP that will perform the following actions:

I know of the existence of PyWin32, but I hear that the API is not complete. So my question is can Python perform these actions on Windows?

Upvotes: 2

Views: 845

Answers (1)

RossFabricant
RossFabricant

Reputation: 12502

Since you only want this to work on Windows, the easiest way to do that is to use os.system and make system-specific calls from within a Python program.

Use the built in Windows tool to run programs at a particular time.

Use shutdown -r to reboot Windows.

Use tasklist to list all processes, then search that list. If you need to manipulate a process as well, the best way I know of is the COM method described here.

Upvotes: 3

Related Questions