import getpass getpass.getuser()
It's been years but have you figured it out how to do this? I have the same problem