调整py脚本

This commit is contained in:
2026-01-28 12:28:04 +08:00
parent edebf424db
commit d1afc64e5a
9 changed files with 195 additions and 831 deletions

View File

@@ -53,7 +53,7 @@ def get_history_records(data_dirs):
if not os.path.exists(d): continue
for f in os.listdir(d):
if f.endswith('.json') and f != 'stat_result.json':
with open(os.path.join(d, f), 'r') as file:
with open(os.path.join(d, f), 'r', encoding='utf-8') as file:
try:
content = json.load(file)
if isinstance(content, list):
@@ -109,6 +109,7 @@ if __name__ == "__main__":
df = pd.DataFrame(all_records).drop_duplicates(subset=['id']).sort_values('time')
df['time'] = pd.to_datetime(df['time'])
print(main(next_period_time, df))
result = main(next_period_time, df)
print(json.dumps(result, ensure_ascii=False))