Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get desktop directory

You can use os.environ["HOMEPATH"] to get the path. Right now it's literally trying to find %HOMEPATH%/Desktop without substituting the actual path.

Maybe something like:

shutil.copy(txtName, os.path.join(os.environ["HOMEPATH"], "Desktop"))
 
PREVIOUS NEXT
Tagged: #python #desktop #directory
ADD COMMENT
Topic
Name
6+2 =