python基础操作

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
上一篇:Java 实现 后端分页


下一篇:布隆过滤器