我有一个使用Python的Tweepy库来抓取流推文的代码。我想在Mac上保留一个月的流媒体推文。你能从技术的角度给我一些建议吗?
发布于 2020-06-12 18:25:09
只需使用time模块即可
import time
print(time.strftime("%b", time.localtime(time.time())))
>>> Jun您可以有条件地检查月份,如下所示:
print(time.strftime("%b", time.localtime(time.time())) == "Jun")
>>> true只需在while循环中执行您的程序
while time.strftime("%b", time.localtime(time.time())) == "Jun":
# your code herehttps://stackoverflow.com/questions/62342082
复制相似问题