调整py脚本
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user