我只想要以 .jpg 或 .pdf 结尾的文件名。如何限制文件名搜索?
import os
from subprocess import call
for dirname, dirnames, filenames in os.walk('.'):
for filename in filenames:
jpg = os.path.join(dirname, filename)
call(["./curl_recognize.sh", jpg, jpg+".txt", "-f txt"])