How to get users home directory path in Python

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

Sample Python

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

Please Share us:
Please rate this snippet

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

Leave a Reply