MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / count_lines

Function count_lines

tools/tools.py:244–252  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

242 break # 如果文件行数少于10行,提前退出
243
244def count_lines(filename):
245 with open(filename, 'r', encoding='utf-8') as file:
246 line_count = 0
247 for line in file:
248 line_count += 1
249 if line_count % 1000000 == 0:
250 print(line_count)
251
252 print(f"文件 {filename} 中的行数为: {line_count}")
253
254
255# def json_pass(infilename, outfilename):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected