Use os.path.expanduser rather than os.environ['HOME']