Get Home Directory with Python in Terminal on Mac - VicPhanDevOps/mac GitHub Wiki

• Type python3 and press the return key to get into the Python shell.
image

• Type import os and press the return key to import the os module.
image

• Type os.path.expanduser(‘~’) and press the return key to get the home directory.
image

⚠️ **GitHub.com Fallback** ⚠️