def secure_delete(path, passes=1):
    with open(path, 'ba+') as delfile:
        length = delfile.tell()
for i in range(passes):
    delfile.seek(0)
delfile.write(os.urandom(length))
Python безопасно удалить файл