Skip to content

Instantly share code, notes, and snippets.

@curzona
Created March 17, 2016 07:47
Show Gist options
  • Save curzona/9afa67131a8ce14168ac to your computer and use it in GitHub Desktop.
Save curzona/9afa67131a8ce14168ac to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import argparse
from xml.dom.minidom import parseString
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args(args)
return args
def main(args=None):
args = parse_args(args)
text = open(args.input, 'rb').read()
xml = parseString(text).toprettyxml()
open(args.output, 'wb').write(xml)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment