一、对HASHsha这个小工具进行了优化:
1、增加csv格式的导出方式;
2、舍弃臃肿的pandas,改换 import csv 和 import xlsxwriter。
第一点,可以从界面和导出文件看到:
第二点,可以从文件夹属性看到:
二、下面是部分代码:
1.用到的包或模块:
import binascii
from tkinter import *
from tkinter import messagebox
import os
import xlsxwriter
import hashlib
import datetime
import tkinter.ttk
import csv
2.读取的16进制转化HASH值:
sha224 = hashlib.sha224(xxxx.encode('utf8'))
3.Excel写入:
time0 = datetime.datetime.now().timestamp()
filename = "HASH(" + str(time0) + ").xlsx"
workbook = xlsxwriter.Workbook(varF_2.get() + "/" + filename)
worksheet = workbook.add_worksheet()
worksheet.set_column('A:B', 57)
worksheet.write_column('A1',listC)
worksheet.write_column('B1',listD)
workbook.close()
4.csv写入:
rows = zip(listC, listD)
print("list结果:", listC, listD)
time0 = datetime.datetime.now().timestamp()
filename = "HASH(" + str(time0) + ").cvs"
with open(varF_2.get() + "/" + filename, "w") as f:
writer = csv.writer(f)
for row in rows:
writer.writerow(row)
5.弹出通知:
messagebox.showinfo("通知(Tips)", "完成(Run complete)")
三、程序包:
https://prodbb45198-pic10.ysjianzhan.cn/upload/HASHsha-simplify.rar