🔵 🔵 🔵


Primary

၊၊||၊|။

os.remove() ⚬|Documentation|1st|20251021120818-00-⌔

os — Miscellaneous operating system interfaces — Python 3 documentation#os.remove

os.remove(path, ﹡, dir_fd=None)

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.

This function can support paths relative to directory descriptors.

On Windows, attempting to remove a file that is in use causes an exception to be raised; on Unix, the directory entry is removed but the storage allocated to the file is not made available until the original file is no longer in use.

This function is semantically identical to unlink().

Raises an auditing event os.remove with arguments path, dir_fd.

Changed in version 3.3: Added the dir_fd parameter.

Changed in version 3.6: Accepts a path-like object.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •