Re: Control if a input text is IP

2006-02-03 Thread Fuzzyman
Fredrik Lundh wrote: > Sbaush wrote: > > > My app has in input an ip address in IPv4 notation. > > is there a function that control if input is a string in IPv4 notation? > > here's one way to do it: Here's a function from the 'validate' module that comes with ConfigObj : def dottedQuadToNum(ip)

Re: Control if a input text is IP

2006-02-02 Thread Sbaush
thanks!! your ipcheck is perfect fo me!!2006/2/3, Fredrik Lundh <[EMAIL PROTECTED]>: Sbaush wrote:> My app has in input an ip address in IPv4 notation.> is there a function that control if input is a string in IPv4 notation?here's one way to do it:def ipcheck(s):try: a, b, c, d = [chr(i