def is_ipv4(ip):
"""Check if the [ip] is a real ip addr.
Params:
ip: :str: General IP format.
Returns:
:type: bool
:desc: if ip is a valid IP addr, return true
else return False"""
try:
IP(ip)
return True
except ValueError:
return False
#----------------------------------------------------------------------
评论列表
文章目录