Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. import json
  2. with open('outfile.json', 'w') as f:
  3. json.dump(mydict, f, indent=4, sort_keys=True)
  4.  
  5. import ruamel.yaml
  6. with open('outfile.yaml', 'w') as f:
  7. ruamel.yaml.round_trip_dump(mydict, f, indent=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement