how to get username of logged in user windows python code example Example: python get username windows username = os.getlogin()