设为首页 加入收藏

TOP

介绍python下wmi模块之二:得到本机的网卡类型和IP地址
2014-11-23 22:25:23 】 浏览:2662
Tags:介绍 python wmi 模块 之二 得到 网卡 类型 地址

这里还是要介绍python下面的wim这个模块,这次我们来介绍如何得到本机的网卡类型,ip和mac地址,代码如下:

#-*- encoding: utf-8 -*-


Created on 2011-3-1

@author: hack7th


import wmi

import time

c = wmi.WMI()

for interface in c.Win32_NetworkAdapterConfiguration (IPEnabled=1):
print interface.Description, interface.MACAddress

for ip_address in interface.IPAddress:

print ip_address


#-*- encoding: utf-8 -*-

Created on 2011-3-1

@author: hack7th

import wmi

import time

c = wmi.WMI()

for interface in c.Win32_NetworkAdapterConfiguration (IPEnabled=1):
print interface.Description, interface.MACAddress

for ip_address in interface.IPAddress:

print ip_address

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇10进制转2进制 下一篇OCI : do NOT debug on TWO diffe..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目