发布时间:2019-08-08 07:46:20编辑:auto阅读(2012)
fr = open(filename)
for line in fr.readlines():
if line.startswith("#"):
continue
else:
## do something with line
## could use fr.readlines()[1:] from second line
import linecache
content_list = linecache.getlines(filename)[1:] ## Here using getlines
fourth_line = linecache.getline(filename, 4) ## Here using getline
## the above method is simpler.
上一篇: python中的字典
下一篇: python操作文本
53100
40022
34407
30158
25057
24856
23230
16710
14863
14358
700°
647°
714°
731°
777°
908°
873°
891°
982°
910°