(target)
Test if a string is an IP address
Test if a string is an IP address
Test if a string is an IP address
def is_ip(target):
    """
    Test if a string is an IP address
    """
    if isinstance(target, str):
        try:
            i = IP(target)
            return True
        except ValueError:
            return False
    else:
        return False
def is_ip ( target ) : if isinstance ( target , str ) : try : i = IP ( target ) return True except ValueError : return False else : return False