本文例項講述了python計算文字檔案行數的方法。 ... myfile = open(filename) lines = len(myfile.readlines()) print "There are %d lines in %s"
確定! 回上一頁