001、
[root@pc1 test]# ls a.txt test.py [root@pc1 test]# cat a.txt 1 2 3 4 5 [root@pc1 test]# cat test.py #!/usr/bin/python in_file = open("a.txt", "r") lines = in_file.readlines() print(len(lines)) [root@pc1 test]# python test.py 5
标签:文件,py,python,pc1,行数,test,txt,root From: https://www.cnblogs.com/liujiaxin2018/p/16837925.html