How can I change my username so that the getuser Python output is different? I am using a windows pc
import datetime
import getpass
print("\n\nFinished execution at ", datetime.datetime.now())
print(getpass.getuser())
ANSWER (AS PER WINDOWS 10)
STEP 1 :- OPEN WINDOWS START MENU AND GO TO SETTINGS.
STEP 2 :- CLICK ON ACCOUNTS -> MANAGE MY MICROSOFT ACCOUNT.
NOTE:- MICROSOFT ACCOUNT WEBPAGE WILL OPEN ON YOUR BROWSER.
STEP 3 :- CLICK ON MORE ACTIONS -> EDIT PROFILE (FROM DROP DOWN MENU).
STEP 4 :- EDIT NAME (UNDER YOUR CURRENT ACCOUNT NAME)
STEP 5:- NOW ENTER FIRST AND LAST NAME AND SAVE.
RESTART YOUR PC TO SEE THE EFFECT.
NOW YOU CAN AGAIN RUN THE PYTHON CODE AND YOU WILL GET THE NEW USERNAME THAT YOU HAVE ASSIGNED.
##### FOR ANY QUERY, KINDLY GET BACK, THANKYOU. #####
Get Answers For Free
Most questions answered within 1 hours.