# 获取文件夹下文件的名称集合
path = 'pic/'
fns = [os.path.join(root,fn) for root, dirs, files in os.walk(path) for fn in files]
redis_obj = RedisOpt(redis_db=0)
img_path_list = [img_path.replace('\\\\', '/').replace('\\','/') for img_path in fns]
for img_path in img_path_list:
print(img_path)
redis_obj.add_set_data(key='pic_local_path', data=img_path)
网友评论