Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import modules
- import os, shutil
- # define a function to remove the files
- def clear_trash():
- # define folder
- folder = '/home/user/.local/share/Trash/files'
- # setup a for lopp to remove the files
- for the_file in os.listdir(folder):
- file_path = os.path.join(folder, the_file)
- try:
- if os.path.isfile(file_path):
- os.unlink(file_path)
- clear_trash()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement