On this page
posixpath.join
Prev: posixpath.ismount | Up: posixpath | Next: posixpath.lexists
Rel: posixpath.abspath, posixpath.basename, posixpath.commonpath, posixpath.commonprefix
Ref: docs.python.org — posixpath.join
Tags: #public #python3 #stdlib #posixpath
Import
import posixpath
from posixpath import join
Signature & Overview
posixpath.join(a, *p)
Join two or more pathname components, inserting '/' as needed.
Usage
import posixpath
assert posixpath.join('/var', 'log', 'app.log') == '/var/log/app.log'
Gotchas
- An absolute segment discards earlier segments:
posixpath.join('/a', '/b') == '/b'.
REPL Inspect
from posixpath import join
help(join)
Linked from
Related notes
- tuts/python3/stdlib_module/posixpath/ismount Linked here; links to this page; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/lexists Linked here; links to this page; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posixpath/abspath Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/basename Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/commonpath Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/commonprefix Linked here; shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/dirname shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/exists shared tags: #posixpath, #stdlib
- tuts/python3/stdlib_module/posixpath/expanduser shared tags: #posixpath, #stdlib