这是我迄今编写的代码,fh = open(fname) if line.startswith("X-DSPAM-Confidence:") : continuecount = 0 if line.startswith("X-DSPAM-Confidence:"):# print(count)
for line
我是python的新手,我正在读一个文件,我想为“X-DSPAM-置信度: 0.7002”提取多个不同的值,我想添加所有不同的置信度。xfile = open('/Users/Documents/python/mbox-short.txt') if not line.startswith("X-DSPAM-Confidence
fh = open(<filename>) if not line.startswith("X-DSPAM-Confidence:") : continue我尝试了: fh = open(<filename>) if not line.startswith("X-DSPAM-Confidence:") : continue