问题描述
我只是对奇怪的行为感到好奇,因为它似乎还运行良好。一般来说,我的工作很简单:
def weather_history_obtain_job(rows=itertuples):
for key in mails.api_keys:
for _ in range(490):
try:
row = next(rows)
except stopiteration:
print('The end of active Tradepoint dates is reached!')
return
weather_frame = get_tp_weather_history(row,key)
weather_frame[_columns].to_csv('weather_history.csv',mode='a',header=None)
同名python库调度:
itertuples = dates_frame.itertuples()
schedule.every().day.at("07:30").do(weather_history_obtain_job)
while True:
schedule.run_pending()
tm.sleep(15)
所以我得到的是几个异常块打印,每天执行一个:
The end of active Tradepoint dates is reached!
The end of active Tradepoint dates is reached!
我的问题是如何执行到异常块,而很明显,迭代器还没有到达终点,继续执行,就像我预期的那样需要两天多的时间才能完成任务?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)