On Fri, 8 Aug 2003, Jerry Amundson wrote:

> And these checks are supposed to be the same?
>      if string.find( ip, '.' ):
>          ipsep = '.'
>      elif string.find( ip, '.' ):
>          ipsep = ':'


Just a note -- I haven't followed the whole thread, but the above is
often a common mistake with Python (I'm not saying it is here, just
pointing out it's a common mistake):

string.find returns -1 on not found, otherwise the index of the 1st char
that matches.  

Your question is correct, though -- those two do the same thing.
What you /really/ want to do (and it's faster) is:

if '.' in ip: ipsep = '.'
or
if string.find(ip,'.') != -1: 
  ipsep = '.'
else:
  raise SomeError

I haven't been following the thread, but I'm quite familiar with Python,
so I can offer limited (only by time and ambition) help.

--
Democracy is two wolves and a sheep voting on what to have for dinner.
Liberty is two wolves attempting to have a sheep for dinner and
finding a well-informed, well-armed sheep.

Jon Nelson <[EMAIL PROTECTED]>
C and Python Code Gardener


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to