【转载】Python 获取网卡设置…
来源:互联网 发布:开淘宝店怎么代销不了 编辑:程序博客网 时间:2024/06/03 20:11
https://code.google.com/p/python-ifconfig/In [14]: ifconfig.ifconfig('lo') 'brdaddr': '0.0.0.0', 'hwaddr': '00:00:00:00:00:00', 'netmask': '255.0.0.0'}
'brdaddr': '172.16.6.255', 'hwaddr': '78:92:9c:88:62:92', 'netmask': '255.255.255.0'}
'brdaddr': '0.29.33.212', 'hwaddr': 'c8:60:00:1d:21:d4', 'netmask': '0.29.33.212'}
下载地址:https://python-ifconfig.googlecode.com/files/python-ifconfig-0.1.tar.gz
Install
sudo wgethttps://python-ifconfig.googlecode.com/files/python-ifconfig-0.1.tar.gz && tar -zxvf python-ifconfig-0.1.tar.gz &&python-ifconfig-0.1.tar.gz && rm cd python-ifconfig-0.1 && python setup.py install && cd .. && rm -rf python-ifconfig-0.1
Usage
>>> from ifconfig import ifconfig
>>> ifconfig('eth0')
{'hwaddr': '00:13:72:85:e8:fb', 'netmask': '255.255.254.0', 'addr': '10.182.120.78', 'brdaddr': '10.182.121.255'}
Out[14]:
{'addr': '127.0.0.1',
In [15]: ifconfig.ifconfig('wlan0')
Out[15]:
{'addr': '172.16.6.177',
In [16]: ifconfig.ifconfig('eth0')
Out[16]:
{'addr': '0.29.33.212',
0 0
- 【转载】Python 获取网卡设置…
- 【转载】设置 PullToRefreshL…
- 【转载】 linux-python …
- 【转载】 linux Python&…
- 【转载】python -- 15个…
- 【转载】Python 基础语法(二)…
- 【转载】python __init__&nbs…
- 【转载】python xml.dom模块…
- 【原创】Python 获取本机内网…
- 【转载+总结】Python 干货
- Linux Atheros AR8131 AR8132 网卡…
- python获取网卡IP地址
- 如何获取网卡物理地址(转载)
- VMware的网卡设置模式(转载)
- 双网卡双ip设置(转载)
- 【转载】pthread_mutex_init …
- VBA 获取和设置(文件和文件夹属性…
- WinAPI: SetWindowsHookEx - 设置…
- 【原创】linux ubuntu12.04&n…
- 【原创】mysql while do…
- 适用小白:为什么要用Jupyter?以及,如何在Linux的Ubuntu 14.04LTS上安装和启动Jupyter Notebook
- 【原创】python 简繁体转换
- 【原创】mysql 正则匹配中文&…
- 【转载】Python 获取网卡设置…
- 【原创】linux使用终端命令执行pyt…
- 【原创】linux ubuntu12.04&n…
- 【原创】linux ubuntu12.04&n…
- 为什么JVM需要 "垃圾回收器" ?
- 【原创】 linux Python&…
- 【转载】 linux Python&…
- 【原创】Python 获取本机内网…
- 导航栏BottomNavigationBar使用