How many ds can you find in:
Q: IP address differences between two computers on the same local network Why does the python command print(socket.gethostbyname(socket.gethostname())) give:
192.168.1.4 on my laptop
127.0.1.1 on my Raspberry PI
when theyre both on the same local network, and the PIs IP address is a static 192.168.1.61?
Please be gentle, Im a bit clueless on networking terminology and understanding :)

A: gethostbyname has been obsolete since getaddrinfo was introduced more than a decade ago. However neither of them are intended to be used to find the IP address of the host your software is running on.
In order to find the IP address of the host your software is running on, the simplest approach is to create a UDP socket and connect it to the remote address you want to communicate with.
import socket
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, 0)
s.connect((2001:db8::, 53))
print s.getsockname()

On a host with multiple IP addresses this may produce different result depending on which remote address you specify in the code.

user
The given text has 42 "d"s.
assistant