windows directories for curr user

Dan Bishop danb_83 at yahoo.com
Wed May 11 02:08:16 EDT 2005


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']




More information about the Python-list mailing list