ID EN
OS

remove

Python 3.11

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

OSError rmdir() FileNotFoundError paths relative to directory descriptors unlink() auditing event path-like object