What is the correct cross-platform way to get the home directory in Python?
I need to get the location of the home directory of the current logged-on user. Currently, I’ve been using the following on Linux:
I need to get the location of the home directory of the current logged-on user. Currently, I’ve been using the following on Linux:
I see that if we change the HOME (linux) or USERPROFILE (windows) environmental variable and run a python script, it returns the new value as the user home when I try