spec = {}
with open(fname, 'r') as fn: #此語法在python2.5或以上可以支持
for ii in fn:
i = ii.strip().split(',')
if len(i) == 3:
m = i[2].strip()
if m.isdigit():
spec[i[0].strip()] = (i[1].strip(), int(m))
return spec