def parse_urls(weeks_urls):
for wkey in weeks_urls.keys():
results=urllib2.urlopen(weeks_urls[wkey])
lines = list(csv.reader(results))
lines=clean_lines(lines)
week_dict=dict.fromkeys(lines[i][1] for i in range(len(lines)))
fare_data=list((lines[i][1:]) for i in range(3,len(lines)))
fare_data=get_fare_data(fare_data)
n=3
for station in week_dict: .....
.......
when I use dict.fromkeys( )
to produce a dict from a list of strings, it automatically sorts them, producing a dict with the strings in alphabetical order. I need to preserve the original order of the string. Is there a way to do this?
grateful for any help here
thanks!