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

pathlib.WindowsPath

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


Import

import pathlib
from pathlib import WindowsPath

Signature & Overview

pathlib.WindowsPath(*args, **kwargs)

Path subclass for Windows systems.

Methods & Attributes

Usage

import os
from pathlib import WindowsPath

if os.name == "nt":
    p = WindowsPath(r"C:\Windows\System32")
    assert p.drive == "C:" and p.is_absolute()

Gotchas

REPL Inspect

from pathlib import WindowsPath
help(WindowsPath)

Linked from

Related notes