ModuleNotFoundError: No module named 'config'
config是个py文件,不能直接from
from config import QINIU_AVAILABLE, OSS_AVAILABLE, REDIS_URI, BASEDIR
下面举个类似例子:
resize_img.py代码
import glob
import cv2
import os
import time
def resize_img():
dir_path = r'D:\2439'
files = glob.glob(dir_path + "/*.png") + glob.glob(dir_path + "/*.jpg")
index = 0
for file in files:
img = cv2.imread(file) # modify the image path to yours
if img.shape[1] != 160:
x_scale = 160 / img.shape[1]
index += 1
img = cv2.resize(img, None, fx&#