update
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
|
||||
lines = []
|
||||
|
||||
with open('wq101alpha.dos', 'r') as f:
|
||||
for line in f:
|
||||
if line.startswith('//'):
|
||||
lines.append(line)
|
||||
|
||||
data = {}
|
||||
|
||||
for i, v in enumerate(lines):
|
||||
if "//alpha" in v:
|
||||
data[v.replace("//", "").replace("\n", "")] = lines[i+1].replace("//", "").replace("\n", "")
|
||||
|
||||
# 将 data 写入当前路径中, json 文件, 命名为 wq101alpha.json
|
||||
with open('wq101alpha.json', 'w') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
print("wq101alpha.json 文件已生成")
|
||||
Reference in New Issue
Block a user