[Q]: How can I get the logged in users username on Win32?

nomad nomad*** at ***freemail.absa.co.za
Fri Mar 16 09:32:27 EST 2001


Thanks - I can stop pulling my hair out now...

On Wed, 14 Mar 2001 22:52:01 GMT, Mark Hammond <MarkH at ActiveState.com>
wrote:

>nomad wrote:
>
>> Howzit,
>> 
>> After searching through the Python Docs, I found that on Un*x I could
>> use getpass.getuser(), but there is no equivalent for the Win32
>> platform.
>> 
>> In other words, how can I get the username in Windows?
>> 
>> As a side note, how can I enable Windows Scripting Host support for
>> python - there is mention of python in the original WSH docs - and if
>> I can use python scripts in WSH how would I call the built-in
>> Wscript.<methods>
>> 
>> TIA
>> 
>> nomad
>
>win32api.GetUserName()
>
>For WSH examples, check out the win32com\test directory.
>
>Mark.
>




More information about the Python-list mailing list