from geometry_info import geometry_info
f=open("AD678_ci.txt","r")
t=geometry_info()
import string
d=t.__dict__
for eachline in f:
eachline = eachline.strip()
eachline = eachline.split("\t")
df=eachline
print df
break
for eachline in f:
eachline = eachline.strip()
eachline = eachline.split("\t")
if " " in eachline:
#去掉文件里面第四个没用的空格
#可以用len(k)==0 or k.isspace(),然后不放进列表
del eachline[3]
elif "" in eachline:
del eachline[3]
else:
eachline=eachline
a=[]
for k in eachline:
k=k.strip()
if " " in k:
g=str(k)
g=g.replace("]",‘‘)
g=g.replace("[",‘‘)
g=g.replace("‘",‘‘)
g=g.split(" ")
a.extend(g)
else :
g=k
a.append(g)
#已经一一对应保存,所以不需要d[name]=value
d[df[0]]=a[0]
d[df[1]]=a[1]
d[df[2]]=a[2]
d[df[3]]=a[3]
d[df[4]]=a[4]
d[df[5]]=a[5]
d[df[6]]=a[6]
d[df[7]]=a[7]
print d