I have a list of dictionaries in python, called all_data
. The structure of each dict
object hold by all_data
is:
{
'href': u'http://malc0de.com/database/index.php?search=c.img001.com',
'type': u'text/html',
'rel': u'alternate',
'title': u'c.img001.com',
'summary': u'URL: c.img001.com/re58/girlshow_20300025849.exe, IP Address: 14.215.74.85, Country: CN, ASN: 58543, MD5: 31d5f481153ccd2829558720f8d90d81',
'title_detail': {
'base': u'http://malc0de.com/rss/',
'type': u'text/plain',
'value': u'c.img001.com',
'language': None
}
}
I want to perform sorting base on the name of 'Country'
which is present as sub-string to the value of 'summary'
key. The content of string is like:
u'URL: c.img001.com/re58/girlshow_20300025849.exe, IP Address: 14.215.74.85, Country: CN, ASN: 58543, MD5: 31d5f481153ccd2829558720f8d90d81',
I want to sort the list
of dict
s based on the Country
name in the alphabetical order.