Skip to content

Instantly share code, notes, and snippets.

@alex21289
alex21289 / get_IP.py
Last active Mar 8, 2020
Network/Python
View get_IP.py
import socket
def main():
def get_IP():
try:
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
host_fqdn = socket.getfqdn()