localise ip code example Example: local ip hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname)