Get Home Directory with Python in Terminal on Mac - DevPops-Inc/python GitHub Wiki
• Type python3 and press the return key to get into the Python shell.
•

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

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