os.remove()

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

Remove (delete) the file path. If path is a directory, OSError is raised. Use rmdir() to remove directories.

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().

New in version 3.3: The dir_fd argument.

doc_python
2016-10-07 17:39:31
Comments
Leave a Comment

Please login to continue.