python获取windows窗口名称_使用Windows在python中获取友好的设备名称

我想使用设备GUID获取网络接口名称.

我对解析接口名称使用“ ipconfig / all”有一个答案

但是“ ipconfig / all”非常复杂…

但这仅显示USB驱动程序.

我可以找到GUID(实际上我不知道该怎么做),其代码如下:

import netifaces as ni

x=ni.interfaces()

print x

像这样的节目[‘{CDC97813-CC28-4260-BA1E-F0CE3081DEC7}’]

我想转换友好的设备名称,例如“本地连接”

解决方法:

代替确实很复杂的ipconfig / all,就输出而言,考虑以下更简单的命令:

>netsh interface show interface

Admin State State Type Interface Name

-------------------------------------------------------------------------

Enabled Connected Dedicated Wireless Network Connection

Enabled Disconnected Dedicated Local Area Connection

要么

>netsh interface ip show interfaces

Idx Met MTU State Name

--- ---------- ---------- ------------ ---------------------------

13 25 1500 connected Wireless Network Connection

12 5 1500 disconnected Local Area Connection

这些对于接口名称而言几乎是微不足道的

标签:guid,windows,python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值