Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
plist to json converter
#!/usr/bin/env python
import plistlib
import json
import sys
def main():
if (len(sys.argv) < 2):
print str(sys.argv[0] + " <plist file>")
sys.exit(1)
plistObject = plistlib.readPlist(sys.argv[1])
jsonFilePath = sys.argv[1].strip(".plist") + ".json"
jsonFile = open(jsonFilePath,"w")
json.dump(plistObject,jsonFile)
jsonFile.close()
if __name__ == "__main__": main()
@danielesegato

This comment has been minimized.

Copy link

danielesegato commented Sep 27, 2013

Thanks :) quick and do what I need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.