連載目次 from os.path import splitroot up = ‘/tmp/foo/bar/baz.txt’ result = splitroot(up) # UNIX環境ではドライブ要素は常に空文字列 print(result) # (”, ‘/’, ‘tmp/foo/bar/baz.txt’) wp = ‘C:\\tmp\\foo\\bar\\baz.txt’ result …
連載目次 from os.path import splitroot up = ‘/tmp/foo/bar/baz.txt’ result = splitroot(up) # UNIX環境ではドライブ要素は常に空文字列 print(result) # (”, ‘/’, ‘tmp/foo/bar/baz.txt’) wp = ‘C:\\tmp\\foo\\bar\\baz.txt’ result …