- expanduser
- ~
- os.path.expanduser
expanduser - handle tilde ~ the home directory of the user
examples/os/expanduser.py
import os # The home directory of the current user home_directory = os.path.expanduser("~") print(home_directory) # /home/gabor # 'C:\\Users\\Gabor Szabo'