tags:

views:

133

answers:

1

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

  • Restart Windows at a given time.
  • Start an exe application.
  • Run a timer to check: is an application still running

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?

+2  A: 

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.

RossFabricant