17 lines
546 B
Python
17 lines
546 B
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
import os
|
|
|
|
master_dir = r'C:\Users\청춘약국\source\animal-medication-api\data\master'
|
|
|
|
for filename in sorted(os.listdir(master_dir)):
|
|
if filename.endswith('.json'):
|
|
filepath = os.path.join(master_dir, filename)
|
|
try:
|
|
with open(filepath, 'r', encoding='utf-8') as f:
|
|
data = json.load(f)
|
|
pid = data.get('product_id', 'NO_ID')
|
|
print(f'OK: {filename} ({pid})')
|
|
except Exception as e:
|
|
print(f'ERROR: {filename} - {e}')
|