Obtenga IPv4 local

hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
Misty Monkey