"rh0dium" <[EMAIL PROTECTED]> writes:
> After thinking about it for a bit longer i simplified it but still have
> the same problem..
>
> e =[]
> hosts = [ "poundcake.fpdn.com", "scorpion.fpdn.com", "loghost",
> "scorpian", "localhost", "lan" ]
>
> ignore = [ "localhost", "loghost", "timehost", "mailhost" ]
>
> for host in hosts:
>     sn = re.split( "\.", host)

This should be host.split(".").

>     if not sn[0] in ignore:
>         e.append(host)
>         ignore.append(sn[0])
> print e
>
> But this STILL gives me some problems..
> ['poundcake.nsc.com', 'scorpion.fqdn.com', 'scorpian', 'lan']
>
> Nope - OK I am an idiot - try spelling idiot..

Can I take it that you saw that "scorpion" is not the same as
"scorpian"?

BTW, if you're using 2.4 and don't care about portability, I'd make
ignore a set instead of a list.

       <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to