My OS is Windows 8.1 and i have Windows 7 and linux debian installed in Vmware. In python (2.7) when i try to get local ip address it shows vmware's ip address(Win7) instead of Win8.1 ip address(picture)! What is the problem?
I have set vmware's network adapter to NAT.
Edit: The code i used: socket.gethostbyname(socket.gethostname())

try use this
import socket
LocalIP = ''.join(socket.gethostbyname_ex(socket.gethostname())[2])
print(LocalIP)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With