PyDocs

Nav

File and Directory Access

splitroot

os.path

function · Added in 3.12
  • splitroot(path, /)
Split a pathname into drive, root and tail.

The tail contains anything after the root.
1 Example
>>> splitroot('/home/sam')
('', '/', 'home/sam')
>>> splitroot('//home/sam')
('', '//', 'home/sam')
>>> splitroot('///home/sam')
('', '/', '//home/sam')
from the Python docs
See Also
No see-alsos for os.path/splitroot
0 Notes
No notes for splitroot