On this page
posix.fspath
Prev: posix.fpathconf | Up: posix | Next: posix.fstat
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.fspath
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import fspath
Signature & Overview
posix.fspath(path)
Return the file system path representation of the object.
Usage
import os
from pathlib import Path
assert os.fspath(Path('a/b')) == 'a/b'
Gotchas
- Import via
os.fspath()for cross-platformPathLikesupport.
REPL Inspect
from posix import fspath
help(fspath)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/fpathconf Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/fstat Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib