import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
import os, ssl
import tkinter as tk
from tkinter import filedialog
import time
from time import sleep
from tkinter import *
from tkinter.ttk import *
from tkinter.filedialog import askopenfile
import time
root = tk.Tk()
root.title('Be4Sec MD5 Calculator')
root.geometry('475x300')
w = Canvas(root)
w.grid()
btn = Button(root, text ='OPEN', command = lambda:open_file())
btn.place(x=102, y=100)
lbl=Label(root, text="Press OPEN to choose a file", font=("Helvetica", 10))
lbl.place(x=80, y=70)
lbl=Label(root, text="File to Calculate", font=("Times", 12))
lbl.place(x=101, y=31)
w.create_line(280, 30, 280, 130, fill="slate blue")
w.create_line(10, 30, 10, 130, fill="slate blue")
w.create_line(10, 130, 280, 130, fill="slate blue")
w.create_line(10, 30, 280, 30, fill="slate blue")
w.create_line(10, 50, 280, 50, fill="slate blue")
lbl=Label(root, text="http://be4sec.blogspot.com/", font=("Times",12))
lbl.place(x=275, y=280)
def hashcalc(file):
hash_md5 = hashlib.md5()
with open(file, "rb") as f:
while chunk := f.read(8192):
hash_md5.update(chunk)
lbl=Label(root, text="File MD5: " + hash_md5.hexdigest(), font=("Helvetica", 10))
lbl.place(x=10, y=190)
def open_file():
up_file = filedialog.askopenfilename()
hashcalc(up_file)
lbl=Label(root, text="File Name: " + up_file, font=("Helvetica", 10))
lbl.place(x=10, y=170)
def Draw():
global text
frame=tk.Frame(root,width=40,height=40,relief='solid',bd=1)
frame.place(x=275,y=250)
text=tk.Label(frame,text='HELLO')
text.pack()
def Refresher():
global text
text.configure(text=time.asctime())
root.after(1000, Refresher)
Draw()
Refresher()
_____________________________________________________________________________________
No comments:
Post a Comment