生成同名JPG的txt文件
import os,redef img_generate_txt(path):filelist = os.listdir(path)for file in filelist: if file.endswith('.jpg'): itemname = os.path.join(path, file) a = re.sub(re.escape(".jpg") + '$', '', itemname) #print(a) #print(pa