getpass在IDLE中报错

CMD中可以使用

import getpass
usr = getpass.getuser
print(usr)

返回值为当前windows登陆用户名

05-11 10:49