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

 

posted @ 2017-06-12 19:17  juejiang  阅读(528)  评论(0编辑  收藏  举报