Answers for "python get desktop directory"

0

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"))
Posted by: Guest on March-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language