source: development/momentum_sink/Sorter.py @ 2891

Last change on this file since 2891 was 2634, checked in by nicholas, 19 years ago

Corrected folder lookups for CCS.py

File size: 660 bytes
Line 
1
2
3import os
4import string
5import operator
6
7B_list_unsorted=os.listdir("buildings_Str_half_Off")
8B_strings=[]
9B_list=[]
10for B_L in B_list_unsorted:
11    A = B_L.split('=')[0] + '=' # first part of string
12    B = float(B_L.split('=')[1].split('_')[0]) # middle part of string
13    C = '_' + B_L.split('=')[1].split('_')[1] # last part of string
14    B_current = [A,B,C]; B_strings.append(B_current)
15
16B_strings.sort(key=operator.itemgetter(1))
17#B_strings.sort(lambda x, y: cmp(x[1],y[1]))
18
19for stt in B_strings:
20    stt[1]=str(stt[1])
21    final=string.join(stt).replace(' ','')
22    B_list.append(final)
23print B_list
24print "you suck222222222"
Note: See TracBrowser for help on using the repository browser.