示例#1
0
文件: main.py 项目: lingboly/plate
def getAuthCode():
    global authCodeRec
    while 1:
            im = pic.getPic(authCodeRec.top.x, authCodeRec.top.y, authCodeRec.bottom.x, authCodeRec.bottom.y)
            authCodeStr = ocr.recognizeAuth(im) 
            print "current auth code " + repr(authCodeStr)
            # if the authCodeStr contains not number, return to get again.
            if authCodeStr.isdigit():
                    return authCodeStr
            else:
                    time.sleep(0.3)
                    print "recognized auth code " + authCodeStr + "contains abnormal value\n"
                    continue
示例#2
0
def getAuthCode():
    global authCodeRec
    while 1:
            im = pic.getPic(authCodeRec.top.x, authCodeRec.top.y, authCodeRec.bottom.x, authCodeRec.bottom.y)
            authCodeStr = ocr.recognizeAuth(im) 
            print "current auth code " + repr(authCodeStr)
            # if the authCodeStr contains not number, return to get again.
            if authCodeStr.isdigit():
                    #if the color is no longer read, then strp 1:4.
                    return authCodeStr[1:4]
                    #return authCodeStr
            else:
                    print "识别到的验证码" + authCodeStr + "包含非法数字\n"
                    continue
示例#3
0
 def do_2(self, arg):
     pic.getPic()