Answers for "python json file reader"

6

python json dump to file

import json
with open('data.json', 'w') as f:
    json.dump(data, f)
Posted by: Guest on August-15-2020
1

write json pythonb

>>> jstr = json.dumps(data, ensure_ascii=False, indent=4)
>>> print(jstr)
{
    "item": "Beer",
    "cost": "£4.00"
}
Posted by: Guest on November-29-2019

Code answers related to "Javascript"

Browse Popular Code Answers by Language