Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get desktop location python

os.path.join(os.environ["HOMEPATH"], "Desktop")
Comment

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"))
Comment

PREVIOUS NEXT
Code Example
Python :: how to open an image in opencv 
Python :: change python3 as default for mac 
Python :: pandas read_csv column names 
Python :: python send http request 
Python :: python count characters 
Python :: create dict from two columns pandas 
Python :: for loop with index python3 
Python :: django get group users 
Python :: pandas dataframe crosstab 
Python :: python write list to excel file 
Python :: pandas pad method 
Python :: enum python 
Python :: print a formatted table using python 
Python :: find index of maximum value in list python 
Python :: convert array to set python 
Python :: python merge lists 
Python :: python letter to number in alphabet 
Python :: python subprocess stdout to dev null 
Python :: robust scaler 
Python :: python if elif else in one line 
Python :: how to find the last item of a list 
Python :: extract data from json file python 
Python :: argparse required arguments 
Python :: python iterate through files 
Python :: check if a the time is 24 hours older python 
Python :: pyramid pattern in python 
Python :: ta-lib python install 
Python :: imread real color cv2 
Python :: how to clear ipython console 
Python :: remove duplicate columns python dataframe 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =