Answer by chjortlund for Python, How to get all external ip addresses with...
Required: WMI / PyWin32 (https://sourceforge.net/projects/pywin32/)Use the following snippet to get the IP of the network card(s) on Windows.import wmic = wmi.WMI()for interface in...
View ArticleAnswer by Patrick for Python, How to get all external ip addresses with...
Get address of all NICs without any external packageimport socketprint socket.gethostbyname_ex(socket.gethostname())[2]
View ArticleAnswer by Mike Pennington for Python, How to get all external ip addresses...
You should use netifaces. It is designed to be cross-platform on Mac OS X, Linux, and Windows.>>> import netifaces as ni>>> ni.interfaces()['lo', 'eth0', 'eth1', 'vboxnet0',...
View ArticleAnswer by Jean-Paul Calderone for Python, How to get all external ip...
For the general case, there is no solution. Consider the case where the local machine is behind a machine with two IP addresses doing NAT. You can change your local interface to anything you like, but...
View ArticleAnswer by Raymond Hettinger for Python, How to get all external ip addresses...
Use the subprocess module to connect to your usual systems tools like ifconfig or netstat:>>> import subprocess>>> print subprocess.check_output(['ifconfig'])
View ArticlePython, How to get all external ip addresses with multiple NICs
What is the most efficient way to get all of the external ip address of a machine with multiple nics, using python? I understand that an external server is neeeded (I have one available) but am un able...
View Article