Created
February 26, 2022 17:06
-
-
Save febimudiyanto/fe5555e6e01667752ae320ce53fb2c66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
def countdown(count): | |
# change text in label | |
# count = '01:30:00' | |
hour, minute, second = count.split(':') | |
hour = int(hour) | |
minute = int(minute) | |
second = int(second) | |
label['text'] = '{}:{}:{}'.format(hour, minute, second) | |
if second > 0 or minute > 0 or hour > 0: | |
# call countdown again after 1000ms (1s) | |
if second > 0: | |
second -= 1 | |
elif minute > 0: | |
minute -= 1 | |
second = 59 | |
elif hour > 0: | |
hour -= 1 | |
minute = 59 | |
second = 59 | |
root.after(1000, countdown, '{}:{}:{}'.format(hour, minute, second)) | |
root = tk.Tk() | |
root.title('L0v3sh3 Ransomware') | |
root.geometry('500x300') | |
root.resizable(False, False) | |
label1 = tk.Label(root, text='Your data is under rest, please don\'t pay me,\nthis just simulation !!\n\n', font=('calibri', 12,'bold')) | |
label1.pack() | |
label = tk.Label(root,font=('calibri', 50,'bold'), fg='white', bg='blue') | |
label.pack() | |
# call countdown first time | |
countdown('01:30:00') | |
# root.after(0, countdown, 5) | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment