On 02/27/2011 10:02 PM, Kaden McLaws wrote:
> I would like to set up the following using python: A timer that is activated 
> when a user logs on to our computer, then shuts the computer down when the 
> timer runs out (no matter what, ending all programs). First, a raw input is 
> used, so that if you know the password, you may shut off the timer (set for 
> 90 mins). Otherwise, it is activated. This is a timer to be used so 
> (anonymous) can only spend 90 mins playing Modern Warfare, and not hours upon 
> end like he does. I was also wondering about parsing. It would be effective 
> if the last time the timer activated was recorded in a txt file, logged, so 
> that the program can check and ensure that the last time the timer ended was 
> at least 12 hours ago, so the computer just isnt turned right back on for 
> another 90 mins repeatedly.Is there also a way to run the python hidden in 
> the background so he cannot just figure out how to close it?If you aren't 
> sure off all the details, email me back. Thanks for helping me save 
> (anonymous) from w
asting too much time on MW2! :)

http://docs.python.org/library/time.html#time.sleep
http://www.microsoft.com/windowsxp/using/helpandsupport/learnmore/ballew_commandline.mspx
(See "Shut Down the System")
http://docs.python.org/whatsnew/2.2.html?highlight=pyw (scroll down)
http://www.tutorial5.com/content/view/157/47/
http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files

Should be everything you need.

-- 
Corey Richardson
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to