def getHistoryResult(self, top=100): text = "" count = 0 for key in self.record.keys(): count += 1 text += (list2str(self.record[key]) + "\n") if count == top: break return text
def make_best_ball(self): recordCount = self.get_best_best_count() records = dict2list(self.record)[:recordCount] redBallList = [] blueBallList = [] for record in records: redBall = record[1][1:-1] blueBall = record[1][-1] redBallList.append(redBall) blueBallList.append(blueBall) redNPList = self.get_best_redBall_ex(redBallList, top=6) blueNPList = self.get_best_blueBall_ex(blueBallList) ssqBall = self.composition_ssq_ball(redNPList, blueNPList) return list2str(ssqBall)
def make_alike_ball(self): recordCount = self.get_alike_best_count() records = dict2list(self.record)[:recordCount] bsList = [] analysisRecord = records[0][1][1:] redBallList = [] blueBallList = [] for record in records: redBall = record[1][1:-1] blueBall = record[1][-1:] redBallList.append(redBall) blueBallList.append(blueBall) ssqBall, errorText = self.make_alike_num_ex(analysisRecord, redBallList, blueBallList) if errorText != "": return errorText return list2str(ssqBall)
def parseSSQNum(self): soup = BeautifulSoup(self.html, "html.parser") subNode = None for child in soup.body.children: flag = child.find("table") if flag != -1: try: subNode = child.table.div except Exception as e: pass ssqNode = None divList = subNode.find_all("div") for div in divList: try: if div["class"][0] == "chart": ssqNode = div.table.tbody except Exception as e: pass records = [] trList = ssqNode.find_all("tr") for tr in trList: record = [] periodNode = tr.td record.append(self.formatPeriod(periodNode.string)) for sibling in periodNode.next_siblings: record.append(sibling.string) redBall = list2str(record[1:7], "\t") blueBall = record[7] record = self.combineRecord(record[0], record[-1], redBall, blueBall) records.append(record + "\n") return records
def makeBestNum(self): balls = self.ssq.makeBestNum() text = list2str(balls) self.makeBestNumUI = ShowWindow(text, "最优概率号码") self.makeBestNumUI.show()
def makeMaxNum(self): balls = self.ssq.makeBySingle() text = list2str(balls) self.makeMaxNumUI = ShowWindow(text, "最大概率号码") self.makeMaxNumUI.show()
def makeRandom(self): record = self.ssq.getRandomNum() text = list2str(record) self.makeRandomUI = ShowWindow(text, "随机号码") self.makeRandomUI.show()
def alikePrediction(self): period = int(self.periodCb.currentText()) - 1 balls, text = self.ssq.getALikeNumForPeriod(period) if text is None: text = list2str(balls) self.aLikeShowUI = ShowWindow(text, "相似概率预测") self.aLikeShowUI.show()
def bestPrediction(self): period = int(self.periodCb.currentText()) - 1 balls = self.ssq.getBestNumForPeriod(period) text = list2str(balls) self.BestShowUI = ShowWindow(text, "最佳概率预测") self.BestShowUI.show()
def maxPrediction(self): period = int(self.periodCb.currentText()) - 1 balls = self.ssq.getMaxNumForPeriod(period) text = list2str(balls) self.MaxShowUI = ShowWindow(text, "最大概率预测") self.MaxShowUI.show()
def makeALike(self): balls, text = self.ssq.getALikeNum() if text is None: text = list2str(balls) self.makeALikeUI = ShowWindow(text, "相似概率号码") self.makeALikeUI.show()