Grig Gheorghiu wrote:
> I use this function as a platform-independent way of finding out the
> current user name:
> 
> def get_username():
>     if sys.platform == 'win32':
>         return win32api.GetUserName()
>     else:
>         return getpass.getuser()
> 


[e:\]python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import getpass
 >>> getpass.getuser()
'idj'

So why bother with the win32api??

--Irmen
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to