src/main/webapp/img/batch_change.py

(完整代码) 492B

#Author chanchan

import shutil

import os

g = os.walk('/home/chanchan/Desktop/minsu/web/img/productSingle_small')

for path,dir_list,file_list in g:
    for file_name in file_list:
        # print(os.path.join(path, file_name) )
        print(file_name)

src='/home/chanchan/Desktop/minsu/web/img/a.jpg'
for file_name in file_list:
        dst='/home/chanchan/Desktop/minsu/web/img/productSingle_small/'+file_name
        shutil.copyfile(src,dst)

'''
遍历所有文件替换成其他
'''

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。