470,604 Members | 2,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,604 developers. It's quick & easy.

windows directories for curr user

Hi,

Short, maybe newbish question: Is there a python method for finding out
who the current user is in the OS module?

On older windows machines the directory I'm interested in is just
"c://my documents", but how do I walk to the current users my documents
folder?

-thanks

Jul 19 '05 #1
2 1290
flamesrock wrote:
Hi,

Short, maybe newbish question: Is there a python method for finding out who the current user is in the OS module?

On older windows machines the directory I'm interested in is just
"c://my documents", but how do I walk to the current users my documents folder?


path = '%s\\My Documents' % os.environ['USERPROFILE']

Jul 19 '05 #2
thanks!!

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Russell E. Owen | last post: by
1 post views Thread by rn5a | last post: by
3 posts views Thread by Denrael | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.