To get users home directory path in Python you can use the following snippet.

Sample Python

import os.path
print os.path.expanduser('~')

One thought on “How to get users home directory path in Python”

Leave a Reply