Spaces:
Sleeping
Sleeping
File size: 527 Bytes
60470bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import json
import os
files = [
r'c:\react_projects\VortexCommerce\kaggle\extra_products_vortex.json',
r'c:\react_projects\VortexCommerce\backend\kaggle\extra_products_vortex.json'
]
for f_path in files:
if os.path.exists(f_path):
with open(f_path, "r", encoding="utf-8") as f:
data = json.load(f)
count = len(data["products"]) if isinstance(data, dict) and "products" in data else len(data)
print(f"{f_path}: {count} products")
else:
print(f"{f_path}: NOT FOUND")
|