Answers for "split path in list of directories"

0

split path in list of directories

>>> from pathlib import Path
>>> Path('C:/path/to/file.txt').parts
('C:\\', 'path', 'to', 'file.txt')
>>> Path(r'C:\path\to\file.txt').parts
('C:\\', 'path', 'to', 'file.txt')
Posted by: Guest on September-17-2021

Code answers related to "split path in list of directories"

Python Answers by Framework

Browse Popular Code Answers by Language