init xiaoxiang project
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
root = Path(r"c:\Users\Administrator\PycharmProjects\pythonProject\小象超市\获取数据清洗\进口水果商品数据编号195")
|
||||
|
||||
for sub in sorted(root.iterdir(), key=lambda p: int(p.name) if p.name.isdigit() else p.name):
|
||||
if not sub.is_dir():
|
||||
continue
|
||||
body = sub / "response_body.json"
|
||||
if not body.is_file():
|
||||
continue
|
||||
with body.open(encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
print(data)
|
||||
Reference in New Issue
Block a user