On Feb 9, 12:15 am, Raymond Hettinger wrote: > You may be able to monkey patch an OrderedDict into the PlistParser. > Here's an untested stab at it: > from collections import OrderedDict > import plistlib > plistlib._InteralDict = OrderedDict
Genius! After fixing the misspelled InteralDict I got this: from collections import OrderedDict import plistlib plistlib._InternalDict = OrderedDict plistlib.readPlist('/path/to/some.plist') --> OrderedDict([('List', 'of'), ('tuples', 'in'), ('plist', 'order')]) So thank you for that [somewhat contorted] solution. To extract the list I am saying this: ordered=plistlib.readPlist(path) print(list(ordered)) # only a list of keys print(ordered[list(ordered)[0]]) However this seems too laborious. is there an easier way? -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-list