敏感词检测工具

# !/usr/bin/python
# -*- coding: utf-8 -*-

import tkinter as tk
from  tkinter import filedialog
import sys
sys.path.append('../')
from CodeLogic.check_senstive_word import saomiao


path_list = []

def visualization():
    window=tk.Tk()
    window.title('敏感词检测工具')
    window.geometry('600x380')

    tk.Label(window,text="文件路径夹:").place(x=10,y=10)
    var_name2=tk.StringVar() #文件夹输入路径变量

    entry_name=tk.Entry(window,textvariable=var_name2,width=55)
    entry_name.place(x=100,y=10)

    #输入文件夹路径
    def selectPath_dir():
        path_ = filedialog.askdirectory()
        var_name2.set(path_)
        path_list.append(path_)
        return path_

    tk.Button(window, text = "路径选择", bg='yellow',height=1,width=9, bd=2, command = selectPath_dir).place(x=520,y=8)
    tk.Label(window,text="敏感词:").place(x=10,y=40)
    label2 = tk.Entry(window,font=("宋体",12),fg="red",width=48)
    label2.place(x=99,y=40)


    def func():
        path_ = path_list[-1]
        senstive_word = label2.get()
        res = saomiao(path_, senstive_word)
        text.insert('insert',"==================================================\n")
        text.insert('insert',"\n".join(res) + "\n")
    #删除函数,text是文本框的名字

    def clearBox():
        text.delete("1.0", "end")

    b1 = tk.Button(window,text="确定", bg='green', disabledforeground='red',command=func).place(x=20,y=72)

    b2 = tk.Button(window,text="清空",bg='red',command=clearBox).place(x=80,y=72)
    # 新建文本框
    text = tk.Text(window, width=82, height=60)
    # 布局
    text.grid(padx=10, pady=110)
    window.mainloop()

if __name__ == '__main__':
    visualization()
import tkinter as tk
from  tkinter import filedialog
import sys
sys.path.append('../')
from CodeLogic.check_digital_signature import check_signers


window=tk.Tk()
window.title('数字签名及文件检测工具')
window.geometry('600x380')

tk.Label(window,text="检查签名文件:").place(x=10,y=10)
var_name=tk.StringVar() #文件输入路径变量


entry_name=tk.Entry(window,textvariable=var_name,width=55)
entry_name.place(x=100,y=10)

path_list = []

#输入文件路径
def selectPath_file():
    path_ = filedialog.askopenfilename(filetypes=[("exe,dll",[".exe", ".dll"])])
    var_name.set(path_)
    path_list.append(path_)
    return path_

#输入文件夹路径
def selectPath_dir():
    path_ = filedialog.askdirectory()
    var_name2.set(path_)
    return path_

def func():
    path_ = path_list[-1]
    res = check_signers(path_)
    text.insert('insert',"==================================================\n")
    text.insert('insert',"\n".join(res) + "\n")


tk.Button(window, text = "选择文件", bg='yellow',height=1,width=9, bd=2, command = selectPath_file).place(x=520,y=8)
# tk.Button(window, text = "路径选择", command = selectPath_dir).place(x=520,y=42)
#删除函数,text是文本框的名字
def clearBox():
    text.delete("1.0", "end")

b1 = tk.Button(window,text="确定", bg='green', disabledforeground='red',command=func).place(x=20,y=42)

b2 = tk.Button(window,text="清空",bg='red', command=clearBox).place(x=80,y=42)
# 新建文本框
text = tk.Text(window, width=82, height=60)
# 布局
text.grid(padx=10, pady=80)
window.mainloop()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值