Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- In [141]: for index, line in enumerate(open(file_path, 'r')): count+=1
- In [156]: count
- Out[156]: 541
- In [157]: # 获取某个文件行数的方法
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement