Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import yaml
- import demjson
- import sys
- files = sys.argv
- if len(sys.argv) <= 1:
- files=(sys.stdin,)
- else:
- files = (open(f) for f in sys.argv[1:])
- for f in files:
- sys.stdout.write(demjson.encode(yaml.load(f), compactly=False))
Advertisement
Add Comment
Please, Sign In to add comment