Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « pathlib » Python 3.11.3

Classe « PurePath »

Informations générales

Héritage

builtins.object
    PurePath

Définition

class PurePath(builtins.object):

help(PurePath)

Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    

Constructeur(s)

Signature du constructeur Description
__new__(cls, *args) Construct a PurePath from one or several strings and or existing [extrait de __new__.__doc__]
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des propriétés

Nom de la propriétéDescription
anchorThe concatenation of the drive and root, or ''. [extrait de __doc__]
driveThe drive prefix (letter or UNC path), if any. [extrait de __doc__]
nameThe final path component, if any. [extrait de __doc__]
parentThe logical parent of the path. [extrait de __doc__]
parentsA sequence of this path's logical parents. [extrait de __doc__]
partsAn object providing sequence-like access to the [extrait de __doc__]
rootThe root of the path, if any. [extrait de __doc__]
stemThe final path component, minus its last suffix. [extrait de __doc__]
suffix
suffixes

Liste des opérateurs

Signature de l'opérateur Description
__eq__(self, other)
__ge__(self, other)
__gt__(self, other)
__le__(self, other)
__lt__(self, other)
__rtruediv__(self, key)
__truediv__(self, key)

Opérateurs hérités de la classe object

__ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__bytes__(self) Return the bytes representation of the path. This is only [extrait de __bytes__.__doc__]
__fspath__(self)
__hash__(self)
__reduce__(self)
__repr__(self)
__str__(self) Return the string representation of the path, suitable for [extrait de __str__.__doc__]
as_posix(self) Return the string representation of the path with forward (/) [extrait de as_posix.__doc__]
as_uri(self) Return the path as a 'file' URI. [extrait de as_uri.__doc__]
is_absolute(self) True if the path is absolute (has both a root and, if applicable, [extrait de is_absolute.__doc__]
is_relative_to(self, *other) Return True if the path is relative to another path or False. [extrait de is_relative_to.__doc__]
is_reserved(self) Return True if the path contains one of the special names reserved [extrait de is_reserved.__doc__]
joinpath(self, *args) Combine this path with one or several arguments, and return a [extrait de joinpath.__doc__]
match(self, path_pattern)
relative_to(self, *other) Return the relative path to another path identified by the passed [extrait de relative_to.__doc__]
with_name(self, name) Return a new path with the file name changed. [extrait de with_name.__doc__]
with_stem(self, stem) Return a new path with the stem changed. [extrait de with_stem.__doc__]
with_suffix(self, suffix) Return a new path with the file suffix changed. If the path [extrait de with_suffix.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __init_subclass__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__