编写的文本展示工具和md5加密

from tkinter import *
import qrcode
from tkinter.filedialog import askopenfilename,asksaveasfilename
from tkinter import scrolledtext
import hashlib
def jiemian_info():
    ws = jiemian.winfo_screenwidth()
    hs = jiemian.winfo_screenheight()
    x = (ws / 2) - 200
    y = (hs / 2) - 200
    print("%d,%d" % (ws, hs))
    return x, y

jiemian = Tk()
jiemian.title("登录小助手")
a, b = jiemian_info()
jiemian.geometry("600x750+%d+%d" % (a, b))
text = scrolledtext.ScrolledText(jiemian,)
text.grid(row=1, column=1, columnspan=3,stick=E+W,pady=10,padx=5)
text1 = scrolledtext.ScrolledText(jiemian,)
text1.grid(row=2, column=1, columnspan=3,stick=E+W,pady=10,padx=5)
def choosepic():
    path_=askopenfilename()
    # path.set(path_)
    with open(path_) as file1:
        file2 = file1.read().split()    #.split()
    text.insert("0.0", file2)
def baocun():
    path = asksaveasfilename()
    path.save()
def jiami():
    neirong = text.get("0.0", "end")
    print(neirong)
    hl = hashlib.md5(neirong.encode(encoding='UTF-8')).hexdigest()  #upper() 字母转换为大写
    text1.delete("0.0", "end")
    text1.insert("0.0", hl)

Button(jiemian,text="打开",command=choosepic).grid(row=0, column=1,pady=10,padx=5,ipadx=20)  #stick=E+W
Button(jiemian,text="保存",command=baocun).grid(row=0, column=2,pady=10,padx=5,ipadx=20)  #stick=E+W
Button(jiemian,text="MD5加密",command=jiami).grid(row=0, column=3,pady=10,padx=5,ipadx=20)  #stick=E+W
jiemian.mainloop()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值