首页 > 解决方案 > 如何使用 if 语句移动包含使用 exiftool 找到的某些 XMP 数据的文件

问题描述

我使用 Exiftool 找到了包含某些 XMP 数据的文件。如果参数符合参数,我如何移动这些文件。

这是我的代码

import os
import subprocess
import sys
filesPath = '/folderpath'
for root, dirs, files in os.walk(filesPath):
    for name in files:
        print("echo", os.path.join(root, name))
        subprocess.call(['exiftool', '-Route','-Final_image_in_location', os.path.join(root, name)])


        if Route = 4 and Final_image_in_location = 1: 
            print ("i got one")

目前 if 语句不起作用

标签: pythonexiftoolxmp

解决方案


推荐阅读