l = ['length_100cm_width_30cm_pict','length_200cm_width_30cm_pict','length_100cm_width_10cm_pict','length_100cm_width_40cm_pict','length_200cm_width_20cm_pict','length_100cm_width_20cm_pict','length_200cm_width_10cm_pict']
l
['length_100cm_width_30cm_pict',
'length_200cm_width_30cm_pict',
'length_100cm_width_10cm_pict',
'length_100cm_width_40cm_pict',
'length_200cm_width_20cm_pict',
'length_100cm_width_20cm_pict',
'length_200cm_width_10cm_pict']
l.sort(key = lambda x:(int(x.split('_')[1][:-2]),int(x.split('_')[3][:-2])))
l
['length_100cm_width_10cm_pict',
'length_100cm_width_20cm_pict',
'length_100cm_width_30cm_pict',
'length_100cm_width_40cm_pict',
'length_200cm_width_10cm_pict',
'length_200cm_width_20cm_pict',
'length_200cm_width_30cm_pict']
参考:http://blog.csdn.net/alvine008/article/details/45367727
http://www.cnblogs.com/MUMO/p/5729007.html