On this page
ntpath.split
Prev: ntpath.samestat | Up: ntpath | Next: ntpath.splitdrive
Rel: ntpath.abspath, ntpath.basename, ntpath.commonpath, ntpath.commonprefix
Ref: docs.python.org — ntpath.split
Tags: #public #python3 #stdlib #ntpath
Import
import ntpath
from ntpath import split
Signature & Overview
ntpath.split(p)
Split a pathname.
Usage
import ntpath
assert ntpath.split(r'C:\a\b.txt') == (r'C:\a', 'b.txt')
Gotchas
- Splits into
(head, tail)wheretailnever contains a slash.
REPL Inspect
from ntpath import split
help(split)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/samestat Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/splitdrive Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ntpath/abspath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/basename Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonpath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonprefix Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/dirname shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/exists shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/expanduser shared tags: #ntpath, #stdlib