|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 Mike_python小 于 2020-6-1 10:58 编辑
最近成熟鱼油了
缺评分
一定要评分呀
上代码
这是一个加密&解密器你就可以和你的另一个小m m 聊 天不 被你 老 婆 发现了
- import ctypes
-
- whnd = ctypes.windll.kernel32.GetConsoleWindow()
- if whnd != 0:
- ctypes.windll.user32.ShowWindow(whnd, 0)
- ctypes.windll.kernel32.CloseHandle(whnd)
- from tkinter import *
- root = Tk()
- root.title('加密/解密')
- root.geometry('400x200')
- def encode():
- s = a.get()
- aa = ' '.join([bin(ord(c)).replace('0b', '') for c in s])
- var.set(aa)
-
- def decode():
- s = a.get()
- aa = ''.join([chr(i) for i in [int(b, 2) for b in s.split(' ')]])
- var.set(aa)
-
- var = StringVar()
- Label(root, text='请输入文字:', font=('楷体', 14)).place(x=10, y=10)
- a = Entry(root, font=('楷体', 14)) # textvariable=var
- a.place(x=120 ,y=10)
- Label(root ,text=' 转换结果:', font=('楷体', 14)).place(x=10, y=50)
- b = Entry(root, font=('楷体', 14) ,textvariable=var)
- b.place(x=120, y=50)
- Button(root, text='加密', font=('楷体', 14), command=encode).place(x= 100, y=100)
- Button(root, text='解密' ,font=('楷体', 14), command=decode).place(x=200, y=100)
- root.mainloop()
复制代码
再说一遍
记得评分呀
|
评分
-
查看全部评分
|