I have a more general question about the os.remove() -function.
When I use it to delete a file, does Python delete it entirely from the computer or does Python move it to another folder similar to the trash on mac?
I have a more general question about the os.remove() -function.
When I use it to delete a file, does Python delete it entirely from the computer or does Python move it to another folder similar to the trash on mac?
os.remove() doesn't send things to Trash. It just deletes them.
You can check it yourself very easily:
import os
file = 'file.txt'
location = "/home/User/Documents"
path = os.path.join(location, file)
os.remove(path)
print("%s has been removed successfully" % file)
os.remove doesn't send things to Trash. It just deletes them.
Here you go for os.remove docs: https://docs.python.org/3/library/os.html#os.remove
Also i notice similar post on stackoverflow: How to permanently delete a file in python 3 and higher?