如何让Python将文件复制到桌面
我该怎么用Python把一个jpeg图片复制到桌面上呢?
import shutil
src = ('1.3.jpg')
dst = ('tEST/nicholas')
count = 1
while count < 10000000000:
shutil.copyfile(src, dst + str(count) + ".jpg")
count += 1
这是我现在写的代码,但我想把目标文件夹改成桌面,因为我用的是Windows 7。
1 个回答
2
只需要定义你桌面的绝对地址。
dst = 'C:\\Users\\[name of your account]\\myfile.txt'