コード例 #1
0
    def sortearDezenas(self):
        self._deleteWidgets()
        # Inserted at the root, program chooses id:
        id = self.Scrolledtreeview1.insert('',
                                           'end',
                                           'widgets',
                                           text='Sorteios')

        self.__adicionarColunas()

        concurso = ConcursoCalculos()

        dezenasSoteadas = concurso.SortearDezenas(self._Loteria, 10)
        for x in dezenasSoteadas:
            total = 0
            l = []

            for num in x:
                l.append(num)
                total = total + int(num)
            l.append(total)

            self.Scrolledtreeview1.insert(id, 'end', text='', values=l)

        self._TotaisTotaisPorDezenas(dezenasSoteadas)
コード例 #2
0
    def __sortearDezenas(self):
        '''Exibe a Lista de Dezenas Sorteadas '''

        numSorteio = self.__IformaQuantidade(10)
        self.__adicionarColunas(self._Loterica.getNumeroBolas() + 1)
        self.tableWidget.setRowCount(numSorteio)

        concurso = ConcursoCalculos()
        dezenasSoteadas = concurso.SortearDezenas(self._Loterica, numSorteio)

        for row, x in enumerate(dezenasSoteadas):
            total = 0
            for col, num in enumerate(x):
                self.__AddItemLinhaTabela(row, col, str(num))
                total = total + int(num)

        self.__calculaTotalRow()
        self.tableWidget.resizeColumnsToContents()