Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > find login name of user?

Reply
Thread Tools

find login name of user?

 
 
rattan@cps.cmich.edu
Guest
Posts: n/a
 
      12-30-2006
Is there a function/module to find the login name of the user under
UNIX environment?

-ishwar

 
Reply With Quote
 
 
 
 
karel
Guest
Posts: n/a
 
      12-30-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Is there a function/module to find the login name of the user under
> UNIX environment?


who
who am i
finger
id


 
Reply With Quote
 
 
 
 
rattan@cps.cmich.edu
Guest
Posts: n/a
 
      12-30-2006

karel wrote:
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > Is there a function/module to find the login name of the user under
> > UNIX environment?

>
> who
> who am i
> finger
> id


I was talking about under python environment.

-ishwar

 
Reply With Quote
 
karel
Guest
Posts: n/a
 
      12-30-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> karel wrote:
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) oups.com...
>> > Is there a function/module to find the login name of the user under
>> > UNIX environment?

>>
>> who
>> who am i
>> finger
>> id

>
> I was talking about under python environment.


Ah! Thanks for enlightening me.
Apologies for misunderstanding.


 
Reply With Quote
 
Uwe Hoffmann
Guest
Posts: n/a
 
      12-30-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) schrieb:
> Is there a function/module to find the login name of the user under
> UNIX environment?



http://docs.python.org/lib/os-procinfo.html

http://docs.python.org/lib/module-pwd.html
 
Reply With Quote
 
Martin P. Hellwig
Guest
Posts: n/a
 
      12-30-2006
Uwe Hoffmann wrote:
> (E-Mail Removed) schrieb:
>> Is there a function/module to find the login name of the user under
>> UNIX environment?

>
>
> http://docs.python.org/lib/os-procinfo.html
>
> http://docs.python.org/lib/module-pwd.html


Speaking of that, is there any reason why there isn't any syntactic
sugar that gives the illusion of platform neutral fetching of the user name?

--
mph
 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      12-31-2006
In message <(E-Mail Removed) .com>,
(E-Mail Removed) wrote:

> Is there a function/module to find the login name of the user under
> UNIX environment?


Note that there isn't really an important concept of "login name" under *NIX
systems. There is the current process UID and GID, effective UID and GID
and so on, but these are just numbers, not names.

The OS doesn't remember anywhere the actual name that you used to login
with; this is conventionally saved in the USER environment variable, but
this is purely for informational purposes.
 
Reply With Quote
 
Brian Beck
Guest
Posts: n/a
 
      01-01-2007
Martin P. Hellwig wrote:
> Speaking of that, is there any reason why there isn't any syntactic
> sugar that gives the illusion of platform neutral fetching of the user
> name?


getpass.getuser() might come the closest:
http://docs.python.org/lib/module-getpass.html

--
Brian Beck
Adventurer of the First Order
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 3 02-14-2011 05:28 AM
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Ant Scripts - Find out login name littlemaster General Computer Support 0 05-22-2009 06:03 PM
Can asp.net find Windows login name? Brad Burke ASP .Net Security 3 11-18-2005 10:50 AM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM



Advertisments