On Jan 30, 7:39 pm, Tim Golden wrote:
> Wes James wrote:
> > If I read a windows registry file with a line like this:
>
> > "{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
> > Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk
Wes James wrote:
If I read a windows registry file with a line like this:
"{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
Multicast|Edge=FALSE|"
Watch out. .reg
Wes James wrote:
If I read a windows registry file with a line like this:
"{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
Multicast|Edge=FALSE|"
with this code:
f
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
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 30, 8:54 am, Wes James wrote:
> If I read a windows registry file with a line like this:
>
> "{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
> Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
> Multicast|Edge
2009/1/29 Wes James :
> 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 thing
If I read a windows registry file with a line like this:
"{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
Multicast|Edge=FALSE|"
with this code:
f=open('fwrules.reg2