某个时间段关闭API
def bet(): if 000000 < int(time.strftime("%H%M%S", time.localtime())) < 90000: print("True") return True else: print("False") return False print("xxxxxx") bet()
如果在晚上0:00到早上9:00之间,那么接口是关闭的

另一种比较好的写法
本文来自博客园,作者:一石数字欠我15w!!!,转载请注明原文链接:https://www.cnblogs.com/52-qq/p/10231832.html

浙公网安备 33010602011771号