Exemple #1
0
 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
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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
Exemple #5
0
 def makeBestNum(self):
     balls = self.ssq.makeBestNum()
     text = list2str(balls)
     self.makeBestNumUI = ShowWindow(text, "最优概率号码")
     self.makeBestNumUI.show()
Exemple #6
0
 def makeMaxNum(self):
     balls = self.ssq.makeBySingle()
     text = list2str(balls)
     self.makeMaxNumUI = ShowWindow(text, "最大概率号码")
     self.makeMaxNumUI.show()
Exemple #7
0
 def makeRandom(self):
     record = self.ssq.getRandomNum()
     text = list2str(record)
     self.makeRandomUI = ShowWindow(text, "随机号码")
     self.makeRandomUI.show()
Exemple #8
0
 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()
Exemple #9
0
 def bestPrediction(self):
     period = int(self.periodCb.currentText()) - 1
     balls = self.ssq.getBestNumForPeriod(period)
     text = list2str(balls)
     self.BestShowUI = ShowWindow(text, "最佳概率预测")
     self.BestShowUI.show()
Exemple #10
0
 def maxPrediction(self):
     period = int(self.periodCb.currentText()) - 1
     balls = self.ssq.getMaxNumForPeriod(period)
     text = list2str(balls)
     self.MaxShowUI = ShowWindow(text, "最大概率预测")
     self.MaxShowUI.show()
Exemple #11
0
 def makeALike(self):
     balls, text = self.ssq.getALikeNum()
     if text is None:
         text = list2str(balls)
     self.makeALikeUI = ShowWindow(text, "相似概率号码")
     self.makeALikeUI.show()