I would like to remove two files from a folder at the conclusion of my script. Do I need to create a function responsible for removing these two specific files? I would like to know in some detail how to use os.remove (if that is what I should use) properly. These two files will always be discarded at the conclusion of my script (which packages a series of files together in a zip format). Thanks in advance.
Share
Just call
os.remove('path/to/file'). For example, to remove the file.emacs, callThe path should be a
strthat’s the pathname of the file. It may be relative or absolute.