def Process_main(self): self.Clear_fo("image\input") self.Clear_fo("exam") List_input = [] M = TR.TR(0) Pc = process.MainProcess(0) for i in range(len(self.newlist)): print str(self.newlist[i]) img = cv2.imread(str(self.newlist[i])) cv2.imwrite("image\input\\exam{:>}.png".format(i), M.ThresholdAndRotate(img, str(i))) List_input.append((self.newlist[i])) #code,list_a,Set,Term=Pc.Process("image\input\\"+str(self.newlist[i])) #self.progressBar_2.setProperty("value", i) #code,list_a,Set,Term=self.Process(str(self.directory)+"\\"+str(self.newlist[i])) #print code,Set,Term LI = os.listdir("image\input\\") for i in range(len(LI)): print LI[i] code, list_a, Set, Term = Pc.Process("image\input\\" + str(LI[i])) print code, Set, Term file = open("exam/{:>}.txt".format(i), "w") file.write(str(List_input[i]) + "\n") file.write(str(code) + "\n") file.write(str(Set) + "\n") file.write(str(Term) + "\n") L = self.List_stand(list_a) for i in range(len(L)): file.write(str(L[i]) + "\n") file.close()
def worker(name,n): U=process.MainProcess(0) code,list_final,List_Set_main,List_term_main=U.Process(name) print code,List_Set_main,List_term_main List.append((code)) file = open("exam/{:>}.txt".format(n), "w") file.write(str(n)+"\n") file.write(str(code)+"\n") file.close()
def P2(): for i in range(10): U=process.MainProcess(0) code,list_final,List_Set_main,List_term_main=U.Process("image\input\\00001.png") print "P2",code,List_Set_main,List_term_main List.append((code)) file = open("exam/{:>}.txt".format(i), "w") file.write(str(i)+"\n") file.write(str(code)+"\n") file.close()
def process(self): #self.pushButton_2.setEnabled(False) import TR self.List_answer = [] self.List_M = [] for i in range(120): self.List_M.append([ 0, 0, 0, 0, 0, ]) import process M = TR.TR(0) img = cv2.imread(str(self.lineEdit.text())) cv2.imwrite("keyimg\\key.png", M.ThresholdAndRotate(img, 1)) self.P = process.MainProcess(0) code, List_answer, Set, Tearm = self.P.Process('keyimg\\key.png') self.List_answer_main = List_answer print "Number:", self.checkNumber(List_answer) self.lineEdit_2.setText("Finish") self.lineEdit_3.setText(str(self.checkNumber(List_answer))) try: self.lineEdit_4.setText(str(Set[0])) except: self.lineEdit_4.setText(str("None")) for i in range(len(List_answer)): print List_answer[i] item = self.listWidget.item(i) item.setText( _translate("DialogAddKeyFormImg", str(i + 1) + ": " + str(List_answer[i]), None)) for i in range(120): print "########################################" for j in range(len(self.List_answer_main[i])): print self.List_answer_main[i][j] if self.List_answer_main[i][j] == 1: self.List_M[i][0] = 1 if self.List_answer_main[i][j] == 2: self.List_M[i][1] = 1 if self.List_answer_main[i][j] == 3: self.List_M[i][2] = 1 if self.List_answer_main[i][j] == 4: self.List_M[i][3] = 1 if self.List_answer_main[i][j] == 5: self.List_M[i][4] = 1 for i in range(120): print i + 1, ":", self.List_M[i]
RELAY_USERNAME = { } # 格式: {姓名:{username: . output_type:输出类型, replay_list_type:转发来源类型, replay_list:转发给该用户的清单} DATA_FILE_PATH = '' SETTING_FILE_PATH = '' logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) THRIFTCLIENT = { 'state': 'offline', 'last_connet_time': 0, 'isLoginin': False, 'error_count': 0 } # 通过thrift 关联的参数 MAINPROCESS = process.MainProcess() def load_contact(update=False): friends_list = itchat.get_friends(update) room_list = itchat.get_chatrooms(update) result = {} for _user in friends_list: _name = '' _pinyin = '' if _user.RemarkName != '': _name = _user.RemarkName try: _pinyin = _user.RemarkPYQuanPin except: