parsing text from a file

Tim Chase python.list at tim.thechases.com
Thu Jan 29 17:36:34 EST 2009


>  if s.find('LANDesk') <0:
> is True for a line which doesn't contain "LANDesk"; if you want the
> opposite, try
>  if s.find('LANDesk') >-1:

Or more pythonically, just use

   if 'LANDesk' in s:

-tkc






More information about the Python-list mailing list