rm_path
-
Description: Removes a path/file.
-
Parameters
- path (
Union[str, Path]): The path/file to be removed.
- path (
-
Behavior
- If
pathis a directory and not a symlink: removed recursively viashutil.rmtree. - Otherwise (regular file/symlink): removed via
Path.unlink().
- If
-
Example
from capybara.utils import rm_path
path = '/path/to/your/directory'
rm_path(path)