ID EN
Pathlib

as_posix

Python 3.11

Return a string representation of the path with forward slashes (/):

Syntax

PYTHON
PurePath.as_posix()

Examples

Example 1
PYTHON
>>> p = PureWindowsPath('c:\\windows')
>>> str(p)
'c:\\windows'
>>> p.as_posix()
'c:/windows'