Posted By

saturngod on 04/22/11


Tagged


Versions (?)

Plist to JSON


 / Published in: Python
 

URL: http://stackoverflow.com/questions/3359546/how-do-i-create-json-file-from-plist-file

  1. import json
  2. from plistlib import readPlist
  3. import StringIO
  4.  
  5. plist = open("source.plist","r").read()
  6.  
  7. in_file = StringIO.StringIO(plist)
  8. plist_dict = readPlist(in_file)
  9.  
  10. open("source.json","w").write(json.dumps(plist_dict))

Report this snippet  

You need to login to post a comment.