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 :

Python 3.11.3

Contenu du module « os.path »

Liste des fonctions du module os.path

Signature de la fonction Description
abspath(path) Return an absolute path. [extrait de abspath.__doc__]
basename(p) Returns the final component of a pathname [extrait de basename.__doc__]
commonpath(paths) Given a sequence of path names, returns the longest common sub-path. [extrait de commonpath.__doc__]
commonprefix(m) Given a list of pathnames, returns the longest common leading component [extrait de commonprefix.__doc__]
dirname(p) Returns the directory component of a pathname [extrait de dirname.__doc__]
exists(path) Test whether a path exists. Returns False for broken symbolic links [extrait de exists.__doc__]
expanduser(path) Expand ~ and ~user constructions. If user or $HOME is unknown, [extrait de expanduser.__doc__]
expandvars(path) Expand shell variables of form $var and ${var}. Unknown variables [extrait de expandvars.__doc__]
getatime(filename) Return the last access time of a file, reported by os.stat(). [extrait de getatime.__doc__]
getctime(filename) Return the metadata change time of a file, reported by os.stat(). [extrait de getctime.__doc__]
getmtime(filename) Return the last modification time of a file, reported by os.stat(). [extrait de getmtime.__doc__]
getsize(filename) Return the size of a file, reported by os.stat(). [extrait de getsize.__doc__]
isabs(s) Test whether a path is absolute [extrait de isabs.__doc__]
isdir(s) Return true if the pathname refers to an existing directory. [extrait de isdir.__doc__]
isfile(path) Test whether a path is a regular file [extrait de isfile.__doc__]
islink(path) Test whether a path is a symbolic link [extrait de islink.__doc__]
ismount(path) Test whether a path is a mount point [extrait de ismount.__doc__]
join(a, *p) Join two or more pathname components, inserting '/' as needed. [extrait de join.__doc__]
lexists(path) Test whether a path exists. Returns True for broken symbolic links [extrait de lexists.__doc__]
normcase(s) Normalize case of pathname. Has no effect under Posix [extrait de normcase.__doc__]
normpath(path) Normalize path, eliminating double slashes, etc. [extrait de normpath.__doc__]
realpath(filename, *, strict=False) Return the canonical path of the specified filename, eliminating any [extrait de realpath.__doc__]
relpath(path, start=None) Return a relative version of a path [extrait de relpath.__doc__]
samefile(f1, f2) Test whether two pathnames reference the same actual file or directory [extrait de samefile.__doc__]
sameopenfile(fp1, fp2) Test whether two open file objects reference the same file [extrait de sameopenfile.__doc__]
samestat(s1, s2) Test whether two stat buffers reference the same file [extrait de samestat.__doc__]
split(p) Split a pathname. Returns tuple "(head, tail)" where "tail" is [extrait de split.__doc__]
splitdrive(p) Split a pathname into drive and path. On Posix, drive is always [extrait de splitdrive.__doc__]
splitext(p) Split the extension from a pathname. [extrait de splitext.__doc__]

Liste des variables globales du module os.path

Nom de la variable globale Valeur
altsep None
curdir .
defpath /bin:/usr/bin
devnull /dev/null
extsep .
pardir ..
pathsep :
sep /
supports_unicode_filenames False