擅长:python、mysql、java
<h3>这可能有助于您……</h3>
<pre><code>import json
a = {'name': 'John Doe', 'age': 24}
js = json.dumps(a)
# Open new json file if not exist it will create
fp = open('test.json', 'a')
# write to json file
fp.write(js)
# close the connection
fp.close()
</code></pre>