level 12
同时保存了jpg和raw。。jpg选完片之后,怎么能快速筛选出同名字的raw文件,一个个选太麻烦了。有什么快速办法没?
2023年06月03日 15点06分
1
level 12
参考33楼代码。 把选出的jpg和所有raw文件 放同一个文件夹下, 代码程序也放同个文件夹,运行。直接选出所有和jpg同名的raw。 简单快捷, 代码需要根据你的raw文件不同的后缀修改、
2023年06月06日 13点06分
47
level 12
参考33楼代码。 把选出的jpg和所有raw文件 放同一个文件夹下, 代码程序也放同个文件夹,运行。直接选出所有和jpg同名的raw。 简单快捷, 代码需要根据你的raw文件不同的后缀修改、
2025年01月31日 14点01分
53
level 12
import os
import shutil
def copy_matching_arw_files():
# 获取当前工作目录
current_dir = os.getcwd()
# 收集所有JPG文件的基本文件名(不区分大小写)
jpg_basenames = set()
for filename in os.listdir(current_dir):
if os.path.splitext(filename)[1].lower() == '.jpg':
jpg_basenames.add(os.path.splitext(filename)[0])
# 收集匹配的ARW文件
arw_files = []
for filename in os.listdir(current_dir):
if os.path.splitext(filename)[1].lower() == '.arw':
basename = os.path.splitext(filename)[0]
if basename in jpg_basenames:
arw_files.append(filename)
if not arw_files:
print("未找到匹配的ARW文件")
return
# 创建目标文件夹
target_dir = os.path.join(current_dir, "ARW_Files")
os.makedirs(target_dir, exist_ok=True)
# 复制文件
for arw_file in arw_files:
src = os.path.join(current_dir, arw_file)
dst = os.path.join(target_dir, arw_file)
shutil.copy2(src, dst)
print(f"已复制: {arw_file}")
print(f"\n成功复制 {len(arw_files)} 个ARW文件到目录: {target_dir}")
if __name__ == "__main__":
copy_matching_arw_files()
2025年02月06日 12点02分
54
直接复制到txt文档, 把后缀改成.py就可以了。 打不开文件 先按提示安装程序 用360就可以
2025年02月06日 12点02分