Advertisement
DOGGYWOOF

Untitled

Apr 25th, 2024
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import os
  2.  
  3. username = "Username"
  4. admin_file_path = f"/disk/users/{username}/admin.txt"
  5. file_to_delete = "filename"
  6.  
  7. if os.path.exists(admin_file_path):
  8. os.remove(file_to_delete)
  9. print(f"{file_to_delete} has been deleted.")
  10. else:
  11. print("Admin file does not exist. Cannot perform deletion.")
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement