Windowsでpython設定タイミングタスク(タイミング実行スクリプト)


ソースコードは次のとおりです.
import os,time
import sys

def DeltaSeconds():
    SECONDS_PER_DAY = 24 * 60 * 60
    from datetime import datetime, timedelta
    curTime = datetime.now()
    desTime = curTime.replace(hour=19, minute=7, second=1, microsecond=0)  #      
    delta = desTime - curTime
    skipSeconds = delta.total_seconds() % SECONDS_PER_DAY
    print "Must sleep %d seconds" % skipSeconds
    return skipSeconds


while True:

    s = DeltaSeconds()
    time.sleep(s)
    print "work it!"  #         

記事の出典:http://blog.csdn.net/utopia_1919