Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

There's more...

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content