[python-win32] Windows "idle" time & killing a process

Randy Syring rsyring at inteli-com.com
Fri Dec 11 15:09:30 CET 2009


I use synergy to connect the keyboard and mouse on my desktop to my 
laptop.  However, I have found that synergy keeps my monitors from 
shutting off when it is running.  I often forget to turn synergy off at 
the end of the day, which means my monitors waste energy and bulb life. 

I would like to write a script in Python that would check if the 
computer had been idle (i.e. no user input) for > 1 hour and if so, shut 
down synergy if it is running.  I would appreciate pointers in two areas:

    * How would I check how long the computer had been idle
    * How would I kill a process if I only know the name

Brief references would be fine, I am happy to go digging.

Thanks.

-- 
--------------------------------------
Randy Syring
Intelicom
502-644-4776

"Whether, then, you eat or drink or 
whatever you do, do all to the glory
of God." 1 Cor 10:31

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20091211/0a17f407/attachment.htm>


More information about the python-win32 mailing list