[Tutor] Windows user variable ?
Smith, Jeff
jsmith at medplus.com
Mon Jun 27 16:42:48 CEST 2005
I would personally suggest using
getpass.getuser()
for maximum portability.
Jeff
-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On
Behalf Of jfouhy at paradise.net.nz
Sent: Sunday, June 26, 2005 6:16 PM
To: tutor at python.org
Subject: Re: [Tutor] Windows user variable ?
Quoting Dave S <pythontut at pusspaws.net>:
> Turned out that I called the file 'memo.txt', Windows decided it was a
> text file and it ended up as 'memo.txt.txt'. The windows display
> strips anything after the '.', found the problem via dos :)
I recomment going to Windows Explorer -> Folder Options and unchecking
the "Hide extensions for known file types" option :-)
> Anyhow - When logged into 2000 as an administrator or user is there a
> system variable that I can read to let the script know who I am logged
> in as ?
If you have the win32 extensions, try win32api.GetUserName().
--
John.
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list