I am writing a script that allows users to use a USB stick as a 2FA Login Key on their computer, but if they accidentally delete the key on the USB their computer would potentially permanently log them out, so I would like to make the key file undeletable by the user.
Can I make the drive read-only in python, or are there any other solutions to stop the file being deleted?
What I have tried:
I cannot find any documentation on doing this, except an old python 2.0 stack overflow thread, so i don't know if it is possible in python 3.11 anymore.