XDMANFROMXDWORLD

Password Leak by Shiro-team

Jul 24th, 2021
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.92 KB | None | 0 0
  1. //LINK: https://bit.ly/3iGvcmp
  2. //File will be .txt
  3.  
  4. //CRACKED BY shiro-team
  5.  
  6. //ignore code below
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. #!/usr/bin/env python3
  37. from tkinter import *
  38. from threading import Thread
  39. from time import sleep
  40.  
  41.  
  42. class Timer(Thread):
  43.     def __init__(self, interval: int, callback: callable):
  44.         super().__init__()
  45.         self.interval = interval
  46.         self.callback = callback
  47.  
  48.     def run(self):
  49.         while True: # NOTE: bad practice
  50.             for i in range(self.interval):
  51.                 print(f"{self.native_id} wait: {i}")
  52.                 sleep(1)
  53.  
  54.             self.callback()
  55.  
  56. class TimingFrame(Frame):
  57.     def __init__(self, parent: Tk):
  58.         super().__init__(parent)
  59.         self.timers = []
  60.         self.callbacks = [self.method1, self.method2]
  61.  
  62.         self.time_interval_holder = IntVar()
  63.        
  64.         Label(self, text="Time interval: ").grid(row=0, column=0)
  65.         self.time_interval_entry = Entry(self, textvariable=self.time_interval_holder)
  66.         self.time_interval_entry.bind("<Return>", lambda event: self.saveNewTimer())
  67.         self.time_interval_entry.grid(row=0, column=1)
  68.  
  69.     def saveNewTimer(self):
  70.         _input: int = self.time_interval_holder.get() # assume it's an int
  71.         callback_index = len(self.timers) % 2
  72.         new_timer = Timer(_input, self.callbacks[callback_index])
  73.         new_timer.setDaemon(True) # NOTE: with this you can ensure that all the Threads are going to terminate immediately
  74.        
  75.         new_timer.start()
  76.         self.timers.append(new_timer)
  77.  
  78.     def method1(self):
  79.         print("method1!!")
  80.  
  81.     def method2(self):
  82.         print("method2!!")
  83.  
  84. class App(Tk):
  85.     def __init__(self):
  86.         super().__init__()
  87.         self.timing_frame = TimingFrame(self)
  88.         self.timing_frame.pack()
  89.  
  90. if __name__ == "__main__":
  91.     main_app = App()
  92.     main_app.mainloop()
Add Comment
Please, Sign In to add comment