mail.python.org/pipermail/boston/2015-July.txt
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.
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.
A string has a method split(); that may help you. > In your case, where you want either a space or a comma as a separator, it depends whether both can be used at the same time. If not, you can check for the occurrence of one or the other separator and run split() with the correct separator.
But in the majority of cases split is used where we read a line > of input from a data file where the data fields are separated > by some arbitrary character, usually comma, tab or pipe. The > important bit is the data not the separator. > > > -- > Alan G > Author of the Learn to Program web site...
A string has a method split(); that may help you. >If not, you can check for > the occurrence of one or the other separator and run split() with the > correct separator. If both can occur in the same line, you may want to use > the regex module instead: re.split() >.