[Baypiggies] String Error Message

admin.dslcomputer at gmail.com admin.dslcomputer at gmail.com
Tue Jul 21 20:24:51 CEST 2015

Hi Everyone:

I'm trying to write a python program that prompts for a file name, then opens that file and reads through the file, looking for lines of the form: X-DSPAM-Confidence:    0.8475

The program is designed to Count these lines and extract the floating point values from each of the lines and compute the average of those values and produce an output as shown below. 

However, line 10 displays the following string syntax error:

SyntaxError: invalid syntax (<string>, line 10)

The raw URL link to the code is available at 

You can download the sample data at  http://www.pythonlearn.com/code/mbox-short.txt 



Sent from Surface
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20150721/47e02d67/attachment.html>

More information about the Baypiggies mailing list