I am looking for a short command to get an network interface ip address by its name, in python.
it did not work with socket.getaddr()
for example, this is my details:

I want a func so:
x=func('vEthernet (VIC Ethernet)')
so that x will be 10.10.255.254 i dont want to run ipconfig and parse it
thanks
you can use this function to get the primary IP:
to get all ips you can use netifaces :
output: