What I'm trying to do is execute a script at a certain time, and for the most part it does work when I run it a short time frame from execution, say around 10 - 15 minutes. So I would run the timer script and 10 - 15 minutes later it executes it's command.
Here is the code I'm using:
import time
import myscript
from sys import exit
while 1:
if time.strftime("%H") == "7" and time.strftime("%M") == "15":
myscript.main()
exit()
What I want is for the script to execute everyday in the morning. When I get to my computer later in the day, I can see that the script is stuck on this process.
I've tried this on two machines, an Ubuntu 12.04 64 bit box and a Windows XP box with cygwin installed and they both show this same issue. When I leave the computers I'm only locking them, not putting them on standby. I've tried running the script and locking it, and then short unlocking it, but I can see that that isn't the issue because the script runs fine.
Also to note, when I to my computer, it seems to be running very laggy and this script seems to be taking an awful lot of CPU usage, in the range of 30 - 50%.
What else am I missing, or is this not the ideal way to go about it?