python 查看windows电脑WIFI密码

#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
os.system("netsh wlan show profiles > wifi_list.txt")
with open("wifi_list.txt") as f:
    data = f.readlines()[10:]
    #print(data)
    num = 1
    
    for i in data:
        print(str(num)+"."+i.replace('所有用户配置文件 :',''))
        num += 1
    select = input("请输入WIFI序号:")
    # print(data[int(select)-1].replace('所有用户配置文件 :',''))
    wifiname = data[int(select)-1].replace('所有用户配置文件 :','').replace("   ","").replace("  ","")
    #print(type(wifiname))
    #print(wifiname)
    str = 'netsh wlan show profiles name="{}" key=clear'.format(wifiname).replace('\n','')
    #print(str)
    os.system(str)
    print("WIFI密码请查看【关键内容】!!!")

 

版权声明:
作者:k, k
链接:http://kuyour.top/index.php/2024/03/07/python-%e6%9f%a5%e7%9c%8bwindows%e7%94%b5%e8%84%91wifi%e5%af%86%e7%a0%81/
来源:KuKey
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
python 查看windows电脑WIFI密码
#!/usr/bin/python # -*- coding: UTF-8 -*- import os os.system("netsh wlan show profiles > wifi_list.txt") with open("wifi_list.txt") as f: ……
<<上一篇
下一篇>>