[Tutor] how to get blank value

Alan Gauld alan.gauld at btinternet.com
Sat Jul 25 17:48:21 CEST 2009

<amrita at iisermohali.ac.in> wrote 

> With these commands:-
> import re
> f = open('chem.txt')
> for line in f:
>     if re.search('C = ',line):
>        print line
> I am getting those lines for which C value is there but how to get those
> one for which it doesn't have any value, i did google search but still i
> am not getting.

Don;t do a Google search, just read the re documentation, 
including the HowTo, looking for how to detect the 
end of a line.

Alan G.

More information about the Tutor mailing list