This commit is contained in:
沈健
2025-06-10 14:04:11 +08:00
parent a09c8b2feb
commit 43e9b5af14
4 changed files with 234 additions and 117 deletions
+11 -11
View File
@@ -83,16 +83,16 @@ def calc(city, year_month):
print("已处理{}条数据".format(count))
print("处理完毕")
if __name__ == '__main__':
yearmonth = sys.argv[1] if len(sys.argv) > 1 else ''
yearmonth = sys.argv[1] if len(sys.argv) > 1 else ''
if yearmonth == '':
date = dateutils.add_months(datetime.today(), months=-1)
yearmonth = int(dateutils.format_date(date, '%Y%m'))
try:
if type(yearmonth) is str:
yearmonth = int(yearmonth)
calc(None, yearmonth)
except Exception as e:
print(e)
if yearmonth == '':
date = dateutils.add_months(datetime.today(), months=-1)
yearmonth = int(dateutils.format_date(date, '%Y%m'))
try:
if type(yearmonth) is str:
yearmonth = int(yearmonth)
calc(None, yearmonth)
except Exception as e:
print(e)