2009/1/29 Wes James <[email protected]>:
> If I read a windows registry file with a line like this:
>
...
>
> with this code:
>
> f=open('fwrules.reg2.txt')
>
> for s in f:
> if s.find('LANDesk') <0:
> print s,
>
>
> LANDesk is not found.
>
> how do I find LANDesk in a string like this. is the "\\" messing things up?
...
>
> thx,
>
> -wj
>
Hi,
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:
hth
vbr
--
http://mail.python.org/mailman/listinfo/python-list