pwd.getpwuid()

pwd.getpwuid(uid) → (pw_name,pw_passwd,pw_uid,

pw_gid,pw_gecos,pw_dir,pw_shell) Return the password database entry for the given numeric user ID. See help(pwd) for more on password database entries.