`os.path.expanduser('~')` is a cross-platform way to get the home directory.