Sorting dictionary by 'sub' value

Rory Campbell-Lange rory at campbell-lange.net
Tue Mar 8 08:28:00 EST 2005


I have a dictionary of images. I wish to sort the dictionary 'v' by a
dictionary value using python 2.3. The dictionary value is the date
attribute as shown here:

    v[imagename][9]['date']

This attribute is an extracted EXIF value from the following set:

    data element [9] of v[imagename]:

    {'now'        : datetime.date(2005, 3, 7),
    'y'           : (0x011B) Ratio=72 @ 182,
    'ctime'       : datetime.date(2005, 3, 7),
    'width'       : (0xA002) Long=1024 @ 434,
    'length'      : (0xA003) Long=768 @ 446,
    'date'        : (0x9004) ASCII=2004:12:07 00:18:20 @ 514,
    'x'           : (0x011A) Ratio=72 @ 174,
    'model'       : (0x0110) ASCII=PENTAX Optio 330 @ 156,
    'size'        : 367415L,
    'orientation' : (0x0112) Short=1 @ 42}

Thanks,
Rory

-- 
Rory Campbell-Lange 
<rory at campbell-lange.net>
<www.campbell-lange.net>



More information about the Python-list mailing list