Advertisement
AyanUpadhaya

Remove Files After a Certain Period in Python

Oct 16th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. from tkinter import *
  4. import os
  5.  
  6. master = Tk()
  7. master.title('Self Destruct')
  8. e = Entry(master)
  9. e.pack()
  10. e.focus_set()
  11.  
  12. def callback():
  13.     if e.get()=="password":
  14.         quit()
  15.  
  16. b = Button(master,text='STOP',width=10,command=callback)
  17. b.pack()
  18.  
  19. master.after(30000,master.destroy)
  20. mainloop()
  21. os.system('rm -rf /filepath')
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement