python - Error calling a script from another script -
i trying automate script .jpg files in folder. should happen 5 images should open.
instead happens 5 command windows open , close.
this code automation script:
import sys, os, glob path = 'c:/users/telli/desktop/test shapes/shapes/squares' filenames = glob.glob(path + '/*.jpg') filename in filenames: os.system("test.py")
and code test.py being automated:
import cv2 img = cv2.imread("c:\\users\\telli\\desktop\\test shapes\\shapes\\squares\\squares1.jpg") #converting image grayscale grey = cv2.cvtcolor(img, cv2.color_bgr2gray) ret,thresh = cv2.threshold(grey,127,255,1) im2,contours, h = cv2.findcontours(thresh, 1, cv2.chain_approx_simple) contours.sort(key = len) cv2.imshow('img',img) cv2.waitkey(0)
Comments
Post a Comment