(filename)
| 242 | break # 如果文件行数少于10行,提前退出 |
| 243 | |
| 244 | def 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): |
nothing calls this directly
no outgoing calls
no test coverage detected