Guest User

Untitled

a guest
May 26th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import yaml
  4. import demjson
  5. import sys
  6.  
  7. files = sys.argv
  8. if len(sys.argv) <= 1:
  9. files=(sys.stdin,)
  10. else:
  11. files = (open(f) for f in sys.argv[1:])
  12.  
  13. for f in files:
  14. sys.stdout.write(demjson.encode(yaml.load(f), compactly=False))
Advertisement
Add Comment
Please, Sign In to add comment