Skip to content

Instantly share code, notes, and snippets.

@billylindeman
Created June 24, 2011 21:08
Show Gist options
  • Save billylindeman/1045696 to your computer and use it in GitHub Desktop.
Save billylindeman/1045696 to your computer and use it in GitHub Desktop.
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
Copy link

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