filename = “F:\python工程\python02\wordcount.txt”
myfile = open(filename)
lines = len(myfile.readlines())
print(“There are %d lines in %s” % (lines, filename))
python如何统计出txt文件有多少行内容?
猜你喜欢
转载自blog.csdn.net/CZXY18ji/article/details/101634279
今日推荐
周排行