Remove (delete) the file path. If path is a directory, an OSError is raised. Use rmdir() to remove directories. If the file does not exist, a FileNotFoundError is raised.
Syntax
PYTHON
os.remove(path, *, dir_fd=None)
See Also
OSErrorrmdir()FileNotFoundErrorpaths relative to directory descriptorsunlink()auditing eventpath-like object