[英]How can I add flags to just search for a certain tag using Exiftool called by a subprocess within Python
I have some code that lists all the files in a directory and then calls a subprocess to use Exiftool to see the metadata for the images.我有一些代码列出目录中的所有文件,然后调用子进程以使用 Exiftool 查看图像的元数据。 I want to be able to add a flag to see just one specific tag.
我希望能够添加一个标志以仅查看一个特定标签。 How can I do this.
我怎样才能做到这一点。 The flag is -Route.
标志是-Route。 Is it also possible to alert me if a tag isn't a specific value, for example if its meant to be 3 or 4 and it was a 2.
如果标签不是特定值,是否也可以提醒我,例如,如果它是 3 或 4 而它是 2。
My code is.我的代码是。
import os
import subprocess
import sys
filesPath = 'folder to search'
for root, dirs, files in os.walk(filesPath):
for name in files:
print("echo", os.path.join(root, name))
subprocess.call(["exiftool", os.path.join(root, name)])
I have since solved this issue when it comes to adding the flag.从那以后,我在添加标志时解决了这个问题。 It needs to be done as a separate part of the argument.
它需要作为论证的一个单独部分来完成。
import os
import subprocess
import sys
filesPath = 'folder to search'
for root, dirs, files in os.walk(filesPath):
for name in files:
print("echo", os.path.join(root, name))
subprocess.call(['exiftool', '-Route', os.path.join(root, name)])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.