On this page
ntpath.expanduser
Prev: ntpath.exists | Up: ntpath | Next: ntpath.expandvars
Rel: ntpath.abspath, ntpath.basename, ntpath.commonpath, ntpath.commonprefix
Ref: docs.python.org — ntpath.expanduser
Tags: #public #python3 #stdlib #ntpath
Import
import ntpath
from ntpath import expanduser
Signature & Overview
ntpath.expanduser(path)
Expand ~ and ~user constructs.
Usage
import ntpath
assert len(ntpath.expanduser('~')) > 0
Gotchas
- Expands
~usingHOME/USERPROFILE: Leaves unknown~userunchanged.
REPL Inspect
from ntpath import expanduser
help(expanduser)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/exists Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/expandvars 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/getatime shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/getctime shared tags: #ntpath, #stdlib