Split a pathname into drive, root and tail. The tail contains anything after the root.
>>> splitroot('/home/sam') ('', '/', 'home/sam') >>> splitroot('//home/sam') ('', '//', 'home/sam') >>> splitroot('///home/sam') ('', '/', '//home/sam')
os.path/splitroot
splitroot