[Py Windows] User Directory Path

Z

Zoool

Hi,

Is there a way to know the main directory path of a user session?
I mean the "C:\Documents and Settings\username" Directory of the user logged
into a windows session.
In .NET you can do this with a :
System.Environment.GetEnvironmentVariable("HOMEDRIVE")
System.Environment.GetEnvironmentVariable("HOMEPATH")

Maybe it's a stupid question that was already answered.. but can't anything
on archives..

thanks a lot

Ben
 
Z

Zoool

Thanks a lot,

os.environ["HOMEDRIVE"]
os.environ["HOMEPATH"]

are what i was looking for ....
 
W

Wolfgang Strobl

Zoool said:
Is there a way to know the main directory path of a user session?
I mean the "C:\Documents and Settings\username" Directory of the user logged
into a windows session.
u'C:\\Dokumente und Einstellungen\\wolfgang'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,299
Latest member
JewelDeLaC

Latest Threads

Top