-
Notifications
You must be signed in to change notification settings - Fork 0
/
recycle_bin_savior.py
40 lines (30 loc) · 1.25 KB
/
recycle_bin_savior.py
1
2
3
4
5
6
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
37
38
39
40
import winshell
import tkinter as tk
import customtkinter
class Recycle_Bin:
def __init__(self):
self.window = tk.Tk()
self.window.geometry("300x150")
self.window.resizable(0, 0)
self.window.title("Empty Recycle Bin")
self.window.configure(bg='#222831')
self.empty()
self.button()
def button(self):
button_ok = customtkinter.CTkButton(master=self.window, corner_radius=10, bg="#3A1078", text="ok", width = 110, command=self.close)
button_ok.pack(padx=10, pady=10)
def close (self):
self.window.destroy()
def empty (self):
try:
winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=True)
label = customtkinter.CTkLabel(master=self.window, text_color="white", text="Recycle bin is emptied Now" , width = 300)
label.pack(padx=20, pady=20)
except:
label = customtkinter.CTkLabel(master=self.window, text_color="white", text="Recycle bin already empty", width = 300)
label.pack(padx=20, pady=20)
def run(self):
self.window.mainloop()
if __name__ == "__main__":
Empty = Recycle_Bin()
Empty.run()