Last active
September 21, 2016 15:53
-
-
Save thomasjk10/512d4f14cbd203f1819d3498797e23fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subject: [sakai] svn commit: r39772 - content/branches/sakai_2-5-x/content-impl/impl/src/java/org/sakaiproject/content/impl | |
X-Content-Type-Outer-Envelope: text/plain; charset=UTF-8 | |
X-Content-Type-Message-Body: text/plain; charset=UTF-8 | |
Content-Type: text/plain; charset=UTF-8 | |
X-DSPAM-Result: Innocent | |
X-DSPAM-Processed: Sat Jan 5 09:14:16 2008 | |
X-DSPAM-Confidence: 0.8475 | |
X-DSPAM-Probability: 0.0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the file name mbox-short.txt as the file name | |
fname = raw_input("Enter file name: ") | |
fh = open(fname) | |
fr = fh.read() | |
fs = fr.strip() | |
sum_conf = 0 | |
count = 0 | |
for line in fh: | |
if not line.startswith("X-DSPAM-Confidence:") : | |
continue | |
check = fs.find(' ') | |
extr = fs[check:] | |
val = float(extr) | |
count = count + 1 | |
sum_conf = sum_conf + val | |
print "Average spam confidence: ", sum_conf/count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please let me know if there are issues in this code. I currently see a 'Divide by Zero' Error.