//获取项目工程里的图片 var fs = require('fs');//引用文件系统模块 var image = require("imageinfo"); //引用imageinfo模块 function readFileList(path, filesList) { var files = fs.readdirSync(path); files.forEach(function (itm, index) { var stat = fs.statSync(path + itm);…
1 #获取文件夹内的图片 2 import os 3 def get_imlist(path): 4 return [os.path.join(path,f) for f in os.listdir(path) if f.endswith('.jpg')] 5 6 img_path = get_imlist("database") 7 print(img_path)…