摘要: 简单模拟了定时器功能,需要的朋友可以自己改写和扩充功能。 import datetimeimport winsoundimport timeimport random def Timer(y, m, d, h, mu, s): '''参数分别为年、月、日、时、分、秒''' stopTime = dateti ...
简单模拟了定时器功能,需要的朋友可以自己改写和扩充功能。
import datetime import winsound import time import random
def Timer(y, m, d, h, mu, s): '''参数分别为年、月、日、时、分、秒''' stopTime = datetime.datetime(y, m, d, h, mu, s) maxTime = stopTime datetime.timedelta(minutes=1) while True: now = datetime.datetime.now() if now