import os
import shutil
origin_folder = "C:/Users/jerry/AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets"
# origin_folder = "//%localappdata//%/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets"
origin_files = os.listdir(origin_folder)
# print(origin_files)
save_folder = "C:/Users/jerry/Desktop/Spotlight"
exist_files = os.listdir(save_folder)
for i in range(len(exist_files)):
try:
exist_files[i] = os.path.splitext(exist_files[i])[0]
except:
continue
# copy img file
for file in origin_files:
if file in exist_files:
continue
else:
file_path = os.path.join(origin_folder,file)
try:
shutil.copy(file_path, save_folder)
except:
continue
# rename
save_files = os.listdir(save_folder)
for filename in save_files:
temp = os.path.splitext(filename)[-1]
print(temp)
if temp != '.bmp':
new_name = filename + '.bmp'
try:
os.rename(os.path.join(save_folder, filename), os.path.join(save_folder, new_name))
except:
continue
else:
continue
提取Win10聚焦壁纸
猜你喜欢
转载自blog.csdn.net/wyr_rise/article/details/105376299
今日推荐
周排行