Answers for "pathlib path forward or back slahses"

0

pathlib path forward or back slahses

>>> import pathlib
>>> p = pathlib.PureWindowsPath(r'\dir\anotherdir\foodir\more')
>>> print(p)    
\dir\anotherdir\foodir\more
>>> print(p.as_posix())
/dir/anotherdir/foodir/more
>>> str(p)
'\\dir\\anotherdir\\foodir\\more'
>>> str(p.as_posix())
'/dir/anotherdir/foodir/more'
Posted by: Guest on November-09-2020

Code answers related to "pathlib path forward or back slahses"

Python Answers by Framework

Browse Popular Code Answers by Language