On this page
ntpath.normpath
Prev: ntpath.normcase | Up: ntpath | Next: ntpath.realpath
Rel: ntpath.abspath, ntpath.basename, ntpath.commonpath, ntpath.commonprefix
Ref: docs.python.org — ntpath.normpath
Tags: #public #python3 #stdlib #ntpath
Import
import ntpath
from ntpath import normpath
Signature & Overview
ntpath.normpath(path)
Normalize path, eliminating double slashes, etc.
Usage
import ntpath
assert ntpath.normpath(r'C:\a\b\..\c') == r'C:\a\c'
Gotchas
- Pure lexical collapse: Can change meaning if symlinks are present.
REPL Inspect
from ntpath import normpath
help(normpath)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/normcase Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/realpath 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