|
|
看到论坛里的其他朋友做的密码查看器,觉得好玩,自己用python写了一个很简陋的查看器
- import tkinter
- from tkinter import ttk
- import os
- import re
-
-
- cmd = "netsh wlan show profiles"
- str0 = os.popen(cmd).read()
- str1 = re.findall('(\u6240\u6709\u7528\u6237\u914d\u7f6e\u6587\u4ef6...)(.*)', str0)
-
- outList1 = []
- outList2 = []
- for i in str1:
- cmd = "netsh wlan show profiles name="" + i[1] + "" key=clear"
- str2 = os.popen(cmd).read()
- output = re.search('(\u5173\u952e\u5185\u5bb9\s*.\s)(.*)', str2).group(2)
- outList1.append(i[1])
- outList2.append(output)
-
- # GUI
- top = tkinter.Tk()
- top.geometry("250x60")
- top.title("Wifi密码查看器")
-
- lab1 = tkinter.Label(top, text="Wifi : ")
- lab2 = tkinter.Label(top, text="PassWord : ")
- lab1.grid(row=0)
- lab2.grid(row=1)
-
- entry = tkinter.Entry(top)
- entry.grid(row=1, column=1)
- cbox = ttk.Combobox(top)
- cbox.grid(row=0, column=1)
- cbox["value"] = outList1
-
- def func(cbox):
- index = cbox.current()
- entry.delete(0, tkinter.END)
- entry.insert(0, outList2[index])
-
- cbox.bind("<<ComboboxSelected>>",lambda event:func(cbox))
-
- top.mainloop()
复制代码 链接:https://zn50.lanzoue.com/iWDDG0j458qd
|
|