Skip to content

Instantly share code, notes, and snippets.

@tetra5
Created February 21, 2013 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetra5/5002453 to your computer and use it in GitHub Desktop.
Save tetra5/5002453 to your computer and use it in GitHub Desktop.
Cross-platform ways of getting user's home directory
import os
os.getenv("HOME")
os.environ["HOME"]
os.path.expanduser("~")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment