Title: how do i change the value of os.path.expanduser("~") in python?
Tags: python;python-idle
Question: hi i am having trouble in running python IDLE.
once i have installed EMACS and uninstalled it, whenever i try to run python IDLE it gives me:
Warning: os.path.expanduser("~") points to
C:\Program Files\Emacs\,
but the path does not exist
the IDLE does work, but i can't launch IDLE by simply clicking on "open with IDLE".
i guess i need to change the path of os.path.expanduser to fix this error?
but i can't find it.
where should i look for and which path does it originally point?
thank you.


Here is another answer: According to the doc,
On Windows, HOME and USERPROFILE will be used if set, otherwise a
combination of HOMEPATH and HOMEDRIVE will be used. An initial ~user
is handled by stripping the last directory component from the created
user path derived above.
You can try run 'set' in command prompt to see if these two environment variables are set or not. If yes, remove the setting.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:05/26/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><python-idle>', 'Title': 'how do i change the value of os.path.expanduser("~") in python?', 'ViewCount': 886, 'id': 10764025, 'user_AboutMe': None, 'user_AccountId': 1421162.0, 'user_DisplayName': 'Jeff Lee', 'user_Reputation': 331.0, 'user_Views': 12.0, 'user_id': 1345727.0}}