python netifaces usage

1. install python dev

sudo apt-get install python-dev

2.download src code and install

https://pypi.python.org/pypi/netifaces/

2.get ip,mac,netmask,gateway

import netifaces

netifaces.interfaces()

netifaces.gateways()

https://pypi.python.org/pypi/netifaces

原文地址:https://www.cnblogs.com/jiangz/p/6994580.html