python 怎么定时每天在凌晨2点 输出hello word 也就是到时间执行print hello word 求具体代码 谢谢
定时执行一般需要符合以下条件
使用cron之类的计划任务程序来调用
程序在后台循环执行
后台循环一般代码:
import time怎么我把current_time.tm_hour == 2 改成9点 就报错了 提示
AttributeError: 'time.struct_time' object has no attribute 'tmin'
不好意思写错了:
if((current_time.tm_hour == 2) and (current_time.tm_min == 0) and (current_time.tm_sec == 0)):