'commit'
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# 读取 Dict 目录下 ChinaCitys2025.json
|
# 读取 Dict 目录下 ChinaCitys2025.json
|
||||||
import json
|
import json
|
||||||
with open(r'D:\dsWork\YunNanProject\Dict\ChinaCitys2025.json', 'r', encoding='utf-8') as f:
|
with open(r'/Dict/ChinaCitys2025.json', 'r', encoding='utf-8') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
# 筛选云南省数据并格式化输出
|
# 筛选云南省数据并格式化输出
|
||||||
try:
|
try:
|
||||||
@@ -16,7 +16,7 @@ with open(r'D:\dsWork\YunNanProject\Dict\ChinaCitys2025.json', 'r', encoding='ut
|
|||||||
# 格式化输出
|
# 格式化输出
|
||||||
print(json.dumps(yunnan_data, ensure_ascii=False, indent=4))
|
print(json.dumps(yunnan_data, ensure_ascii=False, indent=4))
|
||||||
|
|
||||||
with open('../Dict/云南省行政区划数据.json', 'w', encoding='utf-8') as outfile:
|
with open('../../Dict/云南省行政区划数据.json', 'w', encoding='utf-8') as outfile:
|
||||||
json.dump(yunnan_data, outfile, ensure_ascii=False, indent=4)
|
json.dump(yunnan_data, outfile, ensure_ascii=False, indent=4)
|
||||||
print("\n数据已保存至:云南省行政区划数据.json")
|
print("\n数据已保存至:云南省行政区划数据.json")
|
||||||
|
|
0
Tools/Check/__init__.py
Normal file
0
Tools/Check/__init__.py
Normal file
Reference in New Issue
Block a user