f = open('gauss2.txt', 'r')
def readMatrix(f):
new = {'matrix':[], 'op':[]}
line = f.readline()
count = 0
while line != 'END\n':
if line == 'DATA\n' or line == 'OP\n':
count += 1
elif count == 1:
lst = line.split()
newlst = []
for num in lst:
newlst.append(float(num))
new['matrix'].append(newlst)
elif count == 2:
new['op'].append((line.strip()).split())
line = f.readline
f.close()
return new
print readMatrix(f)
为什么说'builtin_function_or_method'对象对于lst = line.split()的行没有属性'split'?