On this page
  1. pathlib.PureWindowsPath
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

pathlib.PureWindowsPath

Prev: pathlib.PurePosixPath | Up: pathlib | Next: pathlib.UnsupportedOperation
Rel: pathlib.Path, pathlib.PosixPath, pathlib.PurePath, pathlib.PurePosixPath
Ref: docs.python.org — pathlib.PureWindowsPath
Tags: #public #python3 #stdlib #pathlib


Import

import pathlib
from pathlib import PureWindowsPath

Signature & Overview

pathlib.PureWindowsPath(*args, **kwargs)

PurePath subclass for Windows systems.

Methods & Attributes

Usage

from pathlib import PureWindowsPath

# Parse Windows drive letters and UNC paths on any OS
p = PureWindowsPath(r"C:\Users\Ada\report.pdf")
assert p.drive == "C:" and p.root == "\\" and p.name == "report.pdf"
assert p.as_posix() == "C:/Users/Ada/report.pdf"

Gotchas

REPL Inspect

from pathlib import PureWindowsPath
help(PureWindowsPath)

Linked from

Related notes