I got this working now. Thanks everybody for your help.
_
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer
--- Begin Message ---
Happy to help. Pass
Mark Devine wrote:
I got the script working. Thanks for all your help everyone. Trouble is its not
showing the correct results. Here is the script and results:
Well, that's a pretty unusual interpretation of the word "working" :-)
> [...]
I see from later postings you are getting closer to an answ
Mark Devine wrote:
> I got the script working. Thanks for all your help everyone. Trouble is
> its not showing the correct results. Here is the script and results:
In my book it is not working then.
> def normalize(text, unwanted = "()", table =
> string.maketrans(string.ascii_uppercase,string.a
If I use:
if el.issubset(testelement):
I get a closer anwser but the brackets cause a problem. They are optional in
the test list so (D) in the test list is equal to D or (D) in the reference
list.
"Mark Devine" <[EMAIL PROTECTED]> wrote:
>
> I got the script working. Thanks for all your he
I got the script working. Thanks for all your help everyone. Trouble is its not
showing the correct results. Here is the script and results:
#!/usr/bin/env python
import os
import sys
import time
import string
import pexpect
import commands
from sets import Set as set
# Test if the words of lis
Thanks. This version is the version that comes with cygwin. They must be behind.
Steven Bethard <[EMAIL PROTECTED]> wrote:
>
> Mark Devine wrote:
> > the trouble is it throws up the following error for set:
> >
> > $ ./test.py
> > Traceback (most recent call last):
> > File "./test.py", line
Mark Devine wrote:
the trouble is it throws up the following error for set:
$ ./test.py
Traceback (most recent call last):
File "./test.py", line 23, in ?
reflist = [normalize(element) for element in list1]
File "./test.py", line 20, in normalize
return set(text.split())
NameError: glob
Thanks for the help. This is the final script:
#!/usr/bin/env python
import os
import sys
import time
import string
import pexpect
import commands
# Test if the words of list2 elements appear in any order in list1 elements
# disregarding case and parens
# Reference list
list1 = ["a b C (D)", "D
Bengt Richter wrote:
On Fri, 17 Dec 2004 02:06:01 GMT, Steven Bethard <[EMAIL PROTECTED]> wrote:
Michael Spencer wrote:
... conv = "".join(char.lower() for char in text if char not in
unwanted)
Probably a good place to use str.replace, e.g.
conv = text.lower()
for char in unwanted:
conv =
On Fri, 17 Dec 2004 02:06:01 GMT, Steven Bethard <[EMAIL PROTECTED]> wrote:
>Michael Spencer wrote:
>> ... conv = "".join(char.lower() for char in text if char not in
>> unwanted)
>
>Probably a good place to use str.replace, e.g.
>
>conv = text.lower()
>for char in unwanted:
> conv = con
Michael Spencer wrote:
... conv = "".join(char.lower() for char in text if char not in
unwanted)
Probably a good place to use str.replace, e.g.
conv = text.lower()
for char in unwanted:
conv = conv.replace(char, '')
Some timings to support my assertion: =)
C:\Documents and Settings\Steve>
Steve Holden <[EMAIL PROTECTED]> writes:
> Mark Devine wrote:
>
>> Actually what I want is element 'class-map match-all cmap1' from list 1 to
>> match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark match-all done'
>> in list 2 but not to match 'class-map cmap1'.
>> Each element in both l
Steve Holden wrote:
Mark Devine wrote:
Actually what I want is element 'class-map match-all cmap1' from list
1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark
match-all done' in list 2 but not to match 'class-map cmap1'.
Each element in both lists have multiple words in them. If a
Actually what I want is element 'class-map match-all cmap1' from list 1 to
match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark match-all done' in
list 2 but not to match 'class-map cmap1'.
Each element in both lists have multiple words in them. If all the words of any
element of the fir
Mark Devine wrote:
Actually what I want is element 'class-map match-all cmap1' from list 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark match-all done' in list 2 but not to match 'class-map cmap1'.
Each element in both lists have multiple words in them. If all the words of any el
"Mark Devine" <[EMAIL PROTECTED]> writes:
> Sorry for not putting a subject in the last e-mail. The function lower suited
> my case exactly. Here however is my main problem:
> Given that my new list is :
> [class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2',
> 'match any', '
Mark Devine wrote:
Sorry for not putting a subject in the last e-mail. The function lower suited
my case exactly. Here however is my main problem:
Given that my new list is :
[class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2',
'match any', 'policy-map policy1', 'class cmap1'
Sorry for not putting a subject in the last e-mail. The function lower suited
my case exactly. Here however is my main problem:
Given that my new list is :
[class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2',
'match any', 'policy-map policy1', 'class cmap1', 'policy-map polic
Helpful subjects help
commands = [c.lower() for c in commands]
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo