发布时间:2019-08-08 07:46:20编辑:auto阅读(1458)
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操作文本
47496
45799
36797
34327
28970
25600
24445
19613
19113
17635
5469°
6051°
5573°
5640°
6575°
5378°
5380°
5887°
5858°
7174°