On Tue, Feb 9, 2010 at 8:07 AM, Gnarlodious wrote:
> 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?
>
I'm not familiar with p
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 Inter
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 Inte
On Feb 8, 8:02 pm, Gnarlodious wrote:
> I am trying to read a *.plist into Python 3's OrderedDict but can't
> figure it out. Saying something like this:
...
> I "upgraded" to Py3 to have OrderedDict, so please don't say it is
> impossible...
You may be able to monkey patch an OrderedDict into the
In article , Terry Reedy
wrote:
> On 2/8/2010 11:02 PM, Gnarlodious wrote:
> > I am trying to read a *.plist into Python 3's OrderedDict but can't
> > figure it out. Saying something like this:
> > from plistlib import readPlist
> As a general note, include a link or something when discussing a
On 2/8/2010 11:02 PM, Gnarlodious wrote:
I am trying to read a *.plist into Python 3's OrderedDict but can't
figure it out. Saying something like this:
from plistlib import readPlist
As a general note, include a link or something when discussing a
relatively obscure module that seems not to e
On Mon, Feb 8, 2010 at 11:02 PM, Gnarlodious wrote:
> I am trying to read a *.plist into Python 3's OrderedDict but can't
> figure it out. Saying something like this:
>
> from plistlib import readPlist
> dict=readPlist('/path/file.plist')
> --> arbitrarily ordered dictionary compared to the XML fi
Gnarlodious writes:
> from plistlib import readPlist
> dict=readPlist('/path/file.plist')
> --> arbitrarily ordered dictionary compared to the XML file
Right. The items in a dict are unordered, and when serialised to a list
they will appear in an arbitrary, unpredictable order.
>>> foo = di