python3_统计多少行

 

list_preferred_net = []
filename = r"E:\AUTO_test\testfile.txt"
myfile = open(filename,encoding = "utf-8")
lines = myfile.readlines()
print("There are %d lines in %s"  %(len(lines), filename))

 

posted @ 2022-02-26 17:29  小鱼小鱼hi  阅读(58)  评论(0)    收藏  举报