def identify(self): print self.cnt name = self.entry.get() org = self.entry2.get() title = self.entry3.get() keyword = self.entry4.get().split() ans = geturl.search(name, org, title, keyword) print ans res = input() if res == 1: self.A += 1 elif res == 2: self.B += 1 elif res == 3: self.C += 1 else: self.D +=1 print self.A,self.B,self.C,self.D
# coding=utf-8 import read import geturl fr = open('fileList.txt','r') fileList = fr.readlines() fr.close() fw = open('ans.txt','a') cnt = 24 n = len(fileList) while cnt <= n: name,title,org,keyword = read.read('reviewer/'+fileList[cnt-1].strip()) url = geturl.search(name,org,title,keyword) fw.write('%s %s %s %s\n' % (name.encode('utf-8'),title.encode('utf-8'),org.encode('utf-8'),url)) print cnt cnt += 1 fw.close()