【发布时间】:2019-12-02 04:26:34
【问题描述】:
我想告诉python脚本在某个时间戳时间发生时运行某个函数
我已经在寻找运行时间特定的功能 但我找不到任何可以回答这个具体问题的东西 计算时间戳
#input is number of days till due date
dueDate = int(input('Days until it is due: '))
#86400 seconds in a day
days = dueDate * 86400
#gets current time stamp time
currentT = int(time.time())
#gets the timestamp for due date
alarm = days+currentT
目的是找到可以在指定的未来时间戳发生时从脚本中运行另一个函数的python函数
【问题讨论】:
-
没有外部软件?你可以使用 pip 安装 python 模块吗?
-
是的,我可以!你有什么推荐?
-
请看我的回答。
标签: python function unix timestamp unix-timestamp