August 2018
Intermediate to advanced
366 pages
10h 14m
English
pathlib.Path actually builds a different object depending on the system we are in. On POSIX systems, it will result in a pathlib.PosixPath object, while on Windows systems, it will lead to a pathlib.WindowsPath object.
It is not possible to build pathlib.WindowsPath on a POSIX system, because it's implemented on top of Windows system calls, which are not available on Unix systems. In case you need to work with Windows paths on a POSIX system (or with POSIX paths on a Windows system), you can rely on pathlib.PureWindowsPath and pathlib.PurePosixPath.
Those two objects won't implement features to actually access the files (read, write, link, resolve absolute paths, and so on), but they will allow you to perform simple operations ...