1

i used "json" to copy dict from "fixer.io" and copy to text file , But indent without writes. i want to paste with indent

import requests,json
r = requests.get('http://data.fixer.io/api/latest?access_key=f9cd762a9bbdf7da0abe6b3a49c62060&format=1')


with open('irakli.json.txt', 'w') as file:
     file.write(json.dumps(r.json()))
no name
  • 51
  • 1
  • 5

0 Answers0