what IP is localhost code example
Example 1: localhost ip
localhost uses the ip address 127.0.0.1
Example 2: local ip
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
localhost uses the ip address 127.0.0.1
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)