我想使用设备GUID获取网络接口名称.我对解析接口名称使用“ ipconfig / all”有一个答案但是“ ipconfig / all”非常复杂…所以我想得到像Getting friendly device names in python但这仅显示USB驱动程序.我可以...

我想使用设备GUID获取网络接口名称.
我对解析接口名称使用“ ipconfig / all”有一个答案
但是“ ipconfig / all”非常复杂…
所以我想得到像Getting friendly device names in python
但这仅显示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
这些对于接口名称而言几乎是微不足道的
沃梦达教程
本文标题为:使用Windows在python中获取友好的设备名称


基础教程推荐
猜你喜欢
- Python 文档解析lxml库的使用详解 2022-10-20
- python异常错误子进程文件丢失-但是什么文件? 2023-11-12
- 停止使用Python 2:您需要了解的关于Python 3的内容| Hackaday 2023-09-04
- python中playwright结合pytest执行用例的实现 2023-08-04
- 适用于Windows的python whois 2023-11-13
- python数据可视化Seaborn绘制山脊图 2023-08-04
- python 类对象的析构释放代码演示 2022-10-20
- Python 页面解析Beautiful Soup库的使用方法 2022-10-20
- python-静态内容上的Django拒绝Nginx权限13 2023-11-13
- 使用nohup ps aux grep kill启动/停止后台Python进程 2023-11-13