擅长:python、mysql、java
<p>将此代码复制到<code>convert.py</code>等文件中</p>
<pre><code>import sys
import json
from pprint import PrettyPrinter, pprint
def main():
fn = sys.argv[1]
with open(fn, 'rb') as f:
data = json.loads(f.read())
for k, v in data.items():
pprint({'word':k, 'transcription':v})
if __name__ == '__main__':
main()
</code></pre>
<p>然后运行命令<code>python convert.py YOUR_JSON_FILE_NAME</code>,尽情享受~</p>