how to discard a line if it's not a number?

dawenliu at dawenliu at
Sat Oct 29 22:29:27 CEST 2005

Hi, I'm reading a file line by line, and whenever a line is not
consisted of a single number (such as 0.315), I want to discard that
line (and store only the single numbers).

For example,

discarded this line of text
forget about me also

Then I want to store only the four numbers into another file, without
the two sentences.  
Suggestions are appreciated!

More information about the Python-list mailing list