python でファイルの行数取得

num_lines = sum(1 for line in open('myfile.txt'))

タグ:

python
最終更新:2016年10月26日 00:50