#!/usr/bin/env python3 import os import pwd import getpass print("LOGNAME: ", type(os.environ["LOGNAME"]), os.environ["LOGNAME"]) print("USER: ", type(os.environ["USER"]), os.environ["USER"]) print("os.getlogin()", type(os.getlogin()), os.getlogin()) print("pwd user: ", type(pwd.getpwuid(os.getuid())[0]), pwd.getpwuid(os.getuid())[0]) print("getpass", type(getpass.getuser()), getpass.getuser())