#!/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密码请查看【关键内容】!!!")
发表回复