#把win10锁屏页面的图片批量导出图片到E:\win10壁纸
import os
import shutil
path=r'C:\Users\Administrator\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets'
to_path=r'E:\Win10壁纸'
#创建文件夹
isExists=os.path.exists(to_path)
if not isExists:
os.makedirs(to_path)
print(to_path+' 创建成功')
else:
print(to_path+' 目录已存在')
all_list=os.listdir(path)
print(all_list)
count=0
for i in all_list:
count+=1
print('复制第{}张'.format(count))
shutil.copyfile(path+'\\'+i,to_path+'\\'+i)
print("复制{}张壁纸完成".format(count))
new_list=os.listdir(to_path)
for i in new_list:
newname=i+".jpg"
os.rename(to_path+'\\'+i,to_path+'\\'+newname)
print("重命名完成")