def check_if_ipv4address(potential_address):
""" check if ipv4address
this is used in conjunction with the flexible parse function
and determines if the word is an ipaddress in a smart way """
try:
ipaddress.IPv4Interface(potential_address)
return True
except ipaddress.AddressValueError:
return False
评论列表
文章目录