def get_own_ip():
own_ip = None<EOL>interfaces = psutil.net_if_addrs()<EOL>for _, details in interfaces.items():<EOL><INDENT>for detail in details:<EOL><INDENT>if detail.family == socket.AF_INET:<EOL><INDENT>ip_address = ipaddress.ip_address(detail.address)<EOL>if not (ip_address.is_link_local or ip_address.is_loopback):<EOL><INDENT>own_ip = str(ip_address)<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return own_ip<EOL>
Gets the IP from the inet interfaces.