1. 按行读取文件
def readNode(filename):
resultList = []
with open(filename, 'r') as f:
while True:
line = f.readline() # string
if not line:
break
if line[0] == '#':
pass
else:
pageNode = line.split()
resultList.append(pageNode)
return resultList