On Unix and Windows, return the argument with an initial component of ~ or ~user replaced by that user’s home directory.
os.path.expanduser(path)