Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

from os.path import expanduser

$
0
0
I am trying to identify the current user folder as part of a larger process. I am using the code

Code:

from os.path import expanduser
HOME = expanduser("~")

If I run the script in the foreground the result is:
Code:

print HOME
'C:\Users\jlay'

However if I enable background processing the result is
Code:

print HOME
'H:\'

Can someone tell me why that is? And how to correct it?

Viewing all articles
Browse latest Browse all 2485

Trending Articles