📜  python 获取桌面目录 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:37.197000             🧑  作者: Mango

代码示例1
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"))