import time def hourly(): h = time.localtime().tm_hour if hourly.last != h: hourly.last = h return True return False hourly.last = None