Facebook
From NovaUser, 4 Years ago, written in Python.
This paste is a reply to Untitled from NovaUser - view diff
Embed
Download Paste or View Raw
Hits: 39
  1. import json
  2. import yaml
  3.  
  4. file_in = input()
  5. file_out = input()
  6. if not file_out:
  7.     file_out = file_in + ".YAML.txt"
  8. with open(file_in, 'r', encoding='utf-8') as json_in, open(file_out, "w", encoding='utf-8') as yaml_out:
  9.     json_object = json.load(json_in)
  10.     yaml.dump(json_object, yaml_out)
captcha