def getSubSetsForCombination(): minMaxIntraListOfTuples = getMinMaxIntraFreqs(); setsForComb = [None] * 6 hg2Obj = atualizaStatisticsEtAl.DezenasHGSingleton() hg2Obj.setNDoJogo(Sena.getNOfLastJogo()) for i in range(6): minIntraDigit, maxIntraDigit = minMaxIntraListOfTuples[i] dif = maxIntraDigit - minIntraDigit if i > 0 and dif >= 5: minIntraDigit = int(minIntraDigit + dif * 0.2) if i < 5 and dif >= 5: maxIntraDigit = int(maxIntraDigit - dif * 0.2) setsForComb[i] = [] for order in range(minIntraDigit, maxIntraDigit + 1): dezenas = hg2Obj.getDezenasWithOrderOfFreq(order) if dezenas == None: continue setsForComb[i] += dezenas setsForComb[i].sort() setsForComb = cleanUpRepeatingDezenas(setsForComb) setsForComb = balanceSets(setsForComb) print '='*40 for i in range(len(setsForComb)): setsForComb[i].sort() print 'Comb', i, 'size', len(setsForComb[i]), setsForComb[i] print '='*40 return setsForComb
def isToExcludeSomeParImpar(nDeRefBackwardJogo=Sena.getNOfLastJogo()): ''' Data Stru. => list with excluded number of evens eg [0, 2, 6] ''' excludeList = [0,6] # 0 nºs pares e 6 nºs pares jogoComp = Sena.jogosPool.getJogo(nDeRefBackwardJogo) nDePares = jogoComp.getNDePares() #print 'nDeRefBackwardJogo', nDeRefBackwardJogo, jogoComp, 'nDePares', nDePares if nDePares in [0,6]: return excludeList if nDePares == 5: excludeList.append(nDePares) return excludeList if nDePares == 1: excludeList.append(nDePares) return excludeList acc = {} acc[2] = 0; acc[3] = 0; acc[4] = 0 # logically, the if below is not needed, but code may change in the future (the way it is is for clearness) if nDePares in [2,3,4]: acc[nDePares] += 1 for i in range(1,4): # go backwards 4 jogos (3 here + 1 above) backwardJogo = Sena.jogosPool.getJogo(nDeRefBackwardJogo-i) nDePares = backwardJogo.getNDePares() #print backwardJogo, 'nDePares', nDePares if nDePares < 2 or nDePares > 4: continue acc[nDePares] += 1 for i in range(2,5): if acc[i] == 4: excludeList.append(i) return excludeList return excludeList
def chainLevel1to2(nOfNextConc=Sena.getNOfLastJogo()+1): filePath = '../Apostas/CombinationsChain-level-1-%s.txt' %(nOfNextConc) inFile = open(filePath) filePathOutput = '../Apostas/CombinationsChain-level-2-%s.txt' %(nOfNextConc) outFile = open(filePathOutput, 'w') line = inFile.readline(); c = 0 while line: dezenas = dezenasIntFromTextLine(line) if dezenas == None: line = inFile.readline() continue c += 1 jogo = Sena.Jogo(-c) jogo.setDezenas(dezenas) tuple2 = filters.passThruFilters(jogo) hasPassed = tuple2[0] if not hasPassed: msgCode = tuple2[1] print jogo, filters.getMessageStrFromFilterReturnNumberCode(msgCode) else: dezenasStrList = map(tmpF, dezenas) dezenasStr = ' '.join(dezenasStrList) outLine = '%s' %(dezenasStr) outFile.write(outLine + '\n') line = inFile.readline() outFile.close()
def searchingJogosNOSE(): ''' NOSE means NOroeste -> SudEste Until now (conc. 986 / 2008-07-13) no NOSE diagonal has been found ''' nose2D = initNoseDiagonals(); oneToSix = xrange(1,7) nDoLastJogo = Sena.getNOfLastJogo() maxDepthInHistory = 0; maxDepthInHistoryNDoJogo = None; depthDict = {} for nDoJogo in xrange(1,nDoLastJogo+1): jogo = Sena.jogosPool.getJogo(nDoJogo) maxDepthInJogo = jogo.getNOSEDepth() try: depthDict[maxDepthInJogo] += 1 except KeyError: depthDict[maxDepthInJogo] = 1 if maxDepthInJogo > 0: print jogo, 'maxDepthInJogo', maxDepthInJogo if maxDepthInJogo > maxDepthInHistory: maxDepthInHistory = maxDepthInJogo maxDepthInHistoryNDoJogo = nDoJogo dezenas = jogo.getDezenas() dezenas.sort() for i in oneToSix: if dezenas[0]==i: #print 'in jogo', nDoJogo, dezenas if dezenas == nose2D[i-1]: print 'Found NOSE', i, 'with jogo', jogo print 'first maxDepthInHistory', maxDepthInHistory, 'in jogo', maxDepthInHistoryNDoJogo print 'depthDict', depthDict
def almostManualJogo(freqOrderSets): if len(freqOrderSets) != 6: raise ValueError combs = []; d = [None] * 6 for d[0] in freqOrderSets[0]: for d[1] in freqOrderSets[1]: for d[2] in freqOrderSets[2]: for d[3] in freqOrderSets[3]: for d[4] in freqOrderSets[4]: for d[5] in freqOrderSets[5]: dezenas = d[:] # hard copy dezenas.sort() combs.append(dezenas) combs.sort(); c = 0 nextConc = Sena.getNOfLastJogo() + 1 apostasFilename = '../Apostas/apostasAlmostManual-%04d.txt' %(nextConc) print 'Begin writing', apostasFilename, 'with', len(combs), 'jogos.' apostasFile = open(apostasFilename, 'w') for dezenas in combs: c += 1 jogo = Sena.Jogo(-c) jogo.setDezenas(dezenas) #print 'filter', jogo, respBool, code = filters.passThruFilters(jogo) if not respBool: pass #print respBool, filters.getMessageStrFromFilterReturnNumberCode(code) else: dezenasList = map(tmpF, dezenas) line = ' '.join(dezenasList) print line apostasFile.write(line + '\n') print 'Closing', apostasFilename, 'with', len(combs), 'jogos.' apostasFile.close()
def chainLevel2toApostas(nOfNextConc=Sena.getNOfLastJogo()+1, nOfCoincIn=3): # read in all jogos filePath = '../Apostas/CombinationsChain-level-2-%d.txt' %(nOfNextConc) inFile = open(filePath) line = inFile.readline(); c = 0 allJogos = [] while line: dezenas = dezenasIntFromTextLine(line) if dezenas == None: line = inFile.readline() continue c += 1 jogo = Sena.Jogo(-c) jogo.setDezenas(dezenas) allJogos.append(jogo) line = inFile.readline() takeOutList = [] originalSize = len(allJogos) allJogos = recursiveDelCoincidentOnes(allJogos, nOfCoincIn) print 'allJogos orig size', originalSize print 'after del, allJogos size', len(allJogos) jogosToBuy = [] for i in range(len(allJogos)): jogo = allJogos[i] jogosToBuy.append(jogo) print jogo generateOutputJogosToBuy(jogosToBuy)
def testPrintX(nOfBackwardJogos=7): if nOfBackwardJogos < 1: nOfBackwardJogos = 1 lastJogo = Sena.getNOfLastJogo() for i in range(nOfBackwardJogos): jogo = Sena.jogosPool.getJogo(lastJogo - i) print jogo print printX(jogo)
def testGenerateImageBars(nOfBackwardJogos=3): if nOfBackwardJogos < 1: nOfBackwardJogos = 1 lastJogo = Sena.getNOfLastJogo() for i in range(nOfBackwardJogos): jogo = Sena.jogosPool.getJogo(lastJogo - i) print jogo print generateImageBars(jogo)
def doCombinations(nOfNextConc=Sena.getNOfLastJogo()+1): filePath = '../Apostas/CombinationsChain-level-1-%s.txt' %(nOfNextConc) dumpFile = open(filePath, 'w') subSets = getSubSetsForCombination(); c=0; d=[None]*6 writeOutSubSets(subSets, nOfNextConc) hg2Patterns = getHg2Patterns() for d[0] in subSets[0]: for d[1] in subSets[1]: if d[1] == d[0]: continue for d[2] in subSets[2]: if d[2] == d[0] or d[2] == d[1]: continue for d[3] in subSets[3]: if d[3] == d[0] or d[3] == d[1] or d[3] == d[2]: continue for d[4] in subSets[4]: doContinue = False for j in range(4): if d[4] == d[j]: doContinue = True break if doContinue: continue for d[5] in subSets[5]: doContinue = False for j in range(5): if d[5] == d[j]: doContinue = True break if doContinue: continue line = ''; c+=1 # DO NOT d.sort() dCopy = d[:] # hard copying "d" dCopy.sort() for j in range(6): line += '%s ' %(str(dCopy[j]).zfill(2)) jogo = Sena.Jogo(-c) jogo.setDezenas(dCopy) hg2Pattern = jogo.getHg2Pattern() ok = False resp = checkIfMoreThanXLettersRepeat(hg2Pattern, 2) if not resp: print 'hg2Pattern (',hg2Pattern,') has more than 2 repeats.' hg2Conform = True if hg2Pattern in hg2Patterns: print 'hg2Pattern (',hg2Pattern,') in hg2Patterns, filtering out' hg2Conform = False if resp and hg2Conform: ok = True if ok: #line = line + hg2Pattern dumpFile.write(line + '\n') if c % 1000 == 0: print c #, line, hg2Pattern, 'ok', ok
def getNOfApostasAndPrice(nOfNextConc=Sena.getNOfLastJogo()+1, pricePer=1.75): filename = '../Apostas/apostas-%04d.txt' %(nOfNextConc) apostasFile = open(filename) apostasLine = apostasFile.readline(); maxCoincPerThisJogo = 0; nOfApostas = 0 while apostasLine: dezenas = vpf.transformLineToDezenasList(apostasLine) if dezenas != None: nOfApostas += 1 apostasLine = apostasFile.readline() totalPrice = nOfApostas * pricePer return nOfApostas, totalPrice
def verifyAcertosDasApostasWithLargerChain1(getLastJogoFromDB=False): dezenasSorteadas = None if getLastJogoFromDB: jogo = Sena.getLastJogo() dezenasSorteadas = jogo.getSorteadosEmOrdemAscendente() nDoConcursoSorteado = jogo.getSeqNum() else: fileIn = open('../Dados/lastJogoParaVerificarAcertosDasApostas.txt') line = fileIn.readline() if line: dezenasList = line.split()[:6] dezenasSorteadas = map(int, dezenasList) nDoConcursoSorteado = Sena.getNOfLastJogo() + 1 testAcertosThruJogos1(dezenasSorteadas, nDoConcursoSorteado)
def percentualDeJogosComUmaDasSeguintesDezenas(dList): ''' This method calculates the percentage any one dezena in a set occurs through Sena history (Based on the idea of 'dezenas de ouro' (too general to have any appeal!) ''' nDeJogos = Sena.getNOfLastJogo(); count=0 for nDoJogo in range(1, nDeJogos+1): jogo = Sena.jogosPool.getJogo(nDoJogo) dezenas = jogo.getDezenas() for d in dezenas: if d in dList: count+=1 break print 'count/nDeJogos', count, '/', nDeJogos, '=', count/(0.0+nDeJogos)
def sorteadasThruAllFilters(getLastJogoFromDB=False): # it needs to get it from verifyAcertosThruJogosWithLastJogo.txt anyway filenameIn = '../Dados/lastJogoParaVerificarAcertosDasApostas.txt' fileIn = open(filenameIn) line = fileIn.readline() if not line: msg = filenameIn + ' is missing, could not be opened.' raise IOError, msg dezenasList = line.split()[:6] dezenasSorteadas = map(int, dezenasList) nDoConcursoSorteado = Sena.getNOfLastJogo() + 1 jogoSorteado = Sena.Jogo(nDoConcursoSorteado) jogoSorteado.setDezenas(dezenasSorteadas) print 'Verificando se jogo nº', nDoConcursoSorteado, dezenasSorteadas, 'passa pelos filtros:' respList = filters.passThruAllFilters(jogoSorteado) for msgCode in respList: print msgCode, filters.getMessageStrFromFilterReturnNumberCode(msgCode)
def testGenerateSixtils(): sixtils = generateSixtils() nDoLastJogo = Sena.getNOfLastJogo() for nDoJogo in range(101, nDoLastJogo): jogo = jogosPool.getJogo(nDoJogo) print jogo, sixtils = generateSixtilsIterative(nDoJogo - 1) dezenas = jogo.getDezenas(); acc = [] for i in range(7): acc.append(0) for dezena in dezenas: for i in range(1,7): if dezena in sixtils[i]: acc[i]+=1 #print 'dezena', dezena, 'no quartil', i for i in range(1, 7): print acc[i], print
def lookUpDivergePattern(self, jogo): nDePares = jogo.getNDePares() if nDePares == 3: goBackwards = 4 elif nDePares in [2, 4]: goBackwards = 2 #elif nDePares in [1,5]: else: goBackwards = 1 nDoLastJogo = Sena.getNOfLastJogo(); coincide = 0 for i in range(goBackwards): nDoJogo = nDoLastJogo - i jogoN = Sena.jogosPool.getJogo(nDoJogo) if nDePares == jogoN.getNDePares(): coincide += 1 if coincide == goBackwards: return False return True
def generateOutputJogosToBuy(jogosToBuy, nOfNextJogo=None): if nOfNextJogo == None: nOfNextJogo = Sena.getNOfLastJogo() + 1 filePath = '../Apostas/apostas-%s.txt' %(str(nOfNextJogo).zfill(4)) print 'Writing file', filePath appFile = open(filePath, 'w') line = '%d:' %(nOfNextJogo) appFile.write(line + '\n') for jogo in jogosToBuy: dezenas = map(tmpF, jogo.getDezenas()) dezenasStr = ' '.join(dezenas) line = '%s' %(dezenasStr) appFile.write(line + '\n') quantToBuy = len(jogosToBuy) line = genLastLineTotalDeApostas(quantToBuy) appFile.write(line + '\n') print quantToBuy, 'apostas recorded.' appFile.close()
def checkAcertosInCombinationsChainFile(nOfRefJogo=Sena.getNOfLastJogo(), chainN=2, changeChainRefNumberTo=None): jogoRef = Sena.jogosPool.getJogo(nOfRefJogo) dezenasSorteadas = jogoRef.getDezenas() nOfRefForChain = nOfRefJogo if changeChainRefNumberTo != None: nOfRefForChain = changeChainRefNumberTo filePath = '../Apostas/CombinationsChain-level-%d-%s.txt' %(chainN, nOfRefForChain) jogoFile = open(filePath) line = jogoFile.readline(); nOfAcertosDict = {} while line: pp = line.split(' ') if len(pp) >= 6: try: dezenasApostadas = map(int, pp[:6]) nOfAcertosDict = volante.compareJogosForAcertos(dezenasApostadas, dezenasSorteadas, nOfAcertosDict) except ValueError: pass line = jogoFile.readline() volante.showStatsForCheckAcertosThruJogos(nOfAcertosDict)
def freqOrderChosenForAlmostManualComb(freqOrderList=None): if freqOrderList == None: freqOrderList = [4,5,15,16,19,23] freqOrderSets = [None] * 6 hg2Obj = atualizaStatisticsEtAl.DezenasHGSingleton() hg2Obj.setNDoJogo(Sena.getNOfLastJogo()) freqOrderSets = map(hg2Obj.getDezenasWithOrderOfFreq, freqOrderList) freqOrderSetsList = [] freqOrderSetsList.append(freqOrderSets) freqOrderList = [3,4,17,21,22,27] freqOrderSets = map(hg2Obj.getDezenasWithOrderOfFreq, freqOrderList) freqOrderSetsList.append(freqOrderSets) freqOrderList = [6,18,20,23,24,26] freqOrderSets = map(hg2Obj.getDezenasWithOrderOfFreq, freqOrderList) freqOrderSetsList.append(freqOrderSets) freqOrderSets = freqOrderSetsList[0] for freqSet in freqOrderSetsList[1:]: for j in range(6): freqOrderSets[j]+=freqSet[j] print almostManualJogo(freqOrderSets)
def searchingPrimes(): ''' searchingPrimes ''' primes = Sena.PRIMES_TILL_60 print 'primes', primes, 'len', len(primes) nDoLastJogo = Sena.getNOfLastJogo() maxNOfPrimesInHistory = 0; maxNOfPrimesInHistoryNDoJogo = None; primesDict = {} for nDoJogo in xrange(1,nDoLastJogo+1): jogo = Sena.jogosPool.getJogo(nDoJogo) nOfPrimes = jogo.getNOfPrimes() if nOfPrimes > maxNOfPrimesInHistory: maxNOfPrimesInHistory = nOfPrimes try: primesDict[nOfPrimes] += 1 except KeyError: primesDict[nOfPrimes] = 1 if nOfPrimes > 1: print jogo, 'nOfPrimes', nOfPrimes print 'primesDict', primesDict
def searchingPrimes(): """ searchingPrimes """ primes = Sena.PRIMES_TILL_60 print "primes", primes, "len", len(primes) nDoLastJogo = Sena.getNOfLastJogo() maxNOfPrimesInHistory = 0 primesDict = {} # ; maxNOfPrimesInHistoryNDoJogo = None; for nDoJogo in xrange(1, nDoLastJogo + 1): jogo = Sena.jogosPool.getJogo(nDoJogo) nOfPrimes = jogo.getNOfPrimes() if nOfPrimes > maxNOfPrimesInHistory: maxNOfPrimesInHistory = nOfPrimes try: primesDict[nOfPrimes] += 1 except KeyError: primesDict[nOfPrimes] = 1 if nOfPrimes > 1: print jogo, "nOfPrimes", nOfPrimes print "primesDict", primesDict
def histogramOfApostasFile(apostasFilename=None): nextConc = Sena.getNOfLastJogo() + 1 if apostasFilename == None: apostasFilename = '../Apostas/apostas-%04d.txt' %(nextConc) else: apostasFilename = '../Apostas/' + apostasFilename lines = open(apostasFilename).readlines(); dezenasHist = {} for line in lines: dezenas = transformLineToDezenasList(line) if dezenas == None: continue for dezena in dezenas: try: dezenasHist[dezena]+=1 except KeyError: dezenasHist[dezena]=1 dezenas = dezenasHist.keys() dezenas.sort(); total = 0 for dezena in dezenas: quant = dezenasHist[dezena] print dezena, quant total += quant print 'n of dezenas =', len(dezenasHist), ' total =', total
def checkApostasFileThruFilters(): nOfLastJogo = Sena.getNOfLastJogo() filePath = '../Apostas/apostas-%04d.txt' %(nOfLastJogo) fileIn = open(filePath) line = fileIn.readline(); c=0; falsesDict = {}; nOfOks = 0 while line: dezenas = volantePrintingFunctions.transformLineToDezenasList(line) if dezenas != None: c+=1 jogo = Sena.Jogo(-c) jogo.setDezenas(dezenas) resp, cod = filters.passThruFilters(jogo) dezenasStrList = map(tmpF, dezenas) dezenasStr = ' '.join(dezenasStrList) print dezenasStr, if not resp: print 'fail pass', cod, filters.getMessageStrFromFilterReturnNumberCode(cod) else: nOfOks += 1 print 'ok' if not resp: try: falsesDict[cod] += 1 except KeyError: falsesDict[cod] = 1 line = fileIn.readline() cods = falsesDict.keys() cods.sort() print '='*40 print 'Histogram for falses from filters:' print '='*40 for cod in cods: print '%2dx %d:%s' %(falsesDict[cod],cod, filters.getMessageStrFromFilterReturnNumberCode(cod)) print '-'*40 percentOfOks = nOfOks * 100 / (0.0 + c) print 'Total', c, ':: ok/total = %5.2f' %(percentOfOks), '%'
def processChain(): doCombinations() chainLevel1to2() nOfCoincIn=3 chainLevel2toApostas(Sena.getNOfLastJogo()+1, nOfCoincIn) putInAscendingOrderInFile()
def processChain2(): nOfCoincIn=3 chainLevel2toApostas(Sena.getNOfLastJogo()+1, nOfCoincIn) putInAscendingOrderInFile()
def putInAscendingOrderInFile(filePath=None): if filePath == None: nOfNextJogo = Sena.getNOfLastJogo() + 1 filePath = '../Apostas/apostas-%s.txt' %(str(nOfNextJogo).zfill(4)) return putInAscendingOrderInFile2(filePath)
def passJogosToGenImageBars(nOfRefJogo=Sena.getNOfLastJogo()): nOfNextJogo = nOfRefJogo + 1 jogosApostados = pickUpJogosInApostasFile(nOfNextJogo) for jogoApostado in jogosApostados: print 'jogoApostado', jogoApostado print generateImageBars(jogoApostado)
#!/usr/bin/env python #-*-coding:utf8-*- justAllocateSomeMemoryBeforeImporting = 1 import Sena jogosPool = Sena.JogosPool() nOfLastJogoParam=Sena.getNOfLastJogo() def passaQuantOfJogosWithMax(maxRepeatInTheRun, quantOfJogosWithThisMax): if maxRepeatInTheRun == 3: if quantOfJogosWithThisMax > 17: return False elif maxRepeatInTheRun == 4: if quantOfJogosWithThisMax > 3: return False return True def analyzeParImparEtAl(): filePath = '../Dados/fileVariacaoParImpar.txt' fileIn = open(filePath) line = fileIn.readline() rem5Dict = {}; rem3Dict = {}; parParImparImparDict = {} while line: if line[0]=='#': line = fileIn.readline() continue if line[-1] == '\n': line = line[:-1] pp = line.split('::') if len(pp) >= 2:
def genDepthOfDezenas(): ''' This method organizes the following info: dezn quant sixtil últ.dist.ocorrida dist.média dist.mín dist.máx últ.dist.ocorrida means the number of concursos passed between two appearances of the same dezena The method accounts for all occurrences of each dezena, and then it calculates the mín, máx and média of these "distances". ''' nOfOccursDict={}; maxDistBetweenOccursDict={}; minDistBetweenOccursDict={} ultDistBetweenOccursDict={}; posOfOccurDict={}; distsOfOccurDict={}; mediaDistBetweenOccursDict={} maxDoMax = 0 minDoMax = 1000 for d in range(1,61): nOfOccursDict[d]=0 maxDistBetweenOccursDict[d]=0 minDistBetweenOccursDict[d]=1000 ultDistBetweenOccursDict[d]=0 posOfOccurDict[d] = 0 distsOfOccurDict[d] = [] # traverse all concursos for nOfJogo in range(1, Sena.getNOfLastJogo() + 1): jogo = Sena.jogosPool.getJogo(nOfJogo) dezenas = jogo.getDezenas() for d in dezenas: nOfOccursDict[d] += 1 if posOfOccurDict[d] > 0: ultDistBetweenOccursDict[d] = nOfJogo - posOfOccurDict[d] distsOfOccurDict[d].append(ultDistBetweenOccursDict[d]) posOfOccurDict[d] = nOfJogo if ultDistBetweenOccursDict[d] > 0: if ultDistBetweenOccursDict[d] > maxDistBetweenOccursDict[d]: maxDistBetweenOccursDict[d] = ultDistBetweenOccursDict[d] if ultDistBetweenOccursDict[d] < minDistBetweenOccursDict[d]: minDistBetweenOccursDict[d] = ultDistBetweenOccursDict[d] filenameOut = '../Dados/analyzeVarDezenasDepth.txt'; nOfLines = 0 print 'Going to write file', filenameOut fileOut = open(filenameOut, 'w') line = '# Stats for Dezenas Depth.' nOfLines += 1; fileOut.write(line + '\n') fileOut.write(line + '\n') medias = [] for d in range(1,61): if maxDistBetweenOccursDict[d] > maxDoMax: maxDoMax = maxDistBetweenOccursDict[d] if maxDistBetweenOccursDict[d] < minDoMax: minDoMax = maxDistBetweenOccursDict[d] soma = 0 for dist in distsOfOccurDict[d]: soma += dist mediaDistBetweenOccursDict[d] = soma / (0.0 + len(distsOfOccurDict[d])) nOfOccurs = nOfOccursDict[d] ult = ultDistBetweenOccursDict[d] pos = posOfOccurDict[d] #min = minDistBetweenOccursDict[d] max = maxDistBetweenOccursDict[d] med = mediaDistBetweenOccursDict[d] medias.append(med) line = '%d %3d x%3d u=%2d m=%2d a=%g' %(d, pos, nOfOccurs, ult, max, med) nOfLines += 1; fileOut.write(line + '\n') mediasNA = numpy.array(medias) mediaDaMedia = mediasNA.sum() / (0.0 + len(mediasNA)) dpDaMedia = mediasNA.std() minDaMedia = mediasNA.min() maxDaMedia = mediasNA.max() line = 'mediaDaMedia %g dpDaMedia %g \n minDaMedia %g maxDaMedia %g' %(mediaDaMedia, dpDaMedia, minDaMedia, maxDaMedia) nOfLines += 2; fileOut.write(line + '\n') line = 'minDoMax %d maxDoMax %d' %(minDoMax, maxDoMax) nOfLines += 1; fileOut.write(line + '\n') line = '# OK, that is all for now folks (nOfLines=%d).' %(nOfLines) nOfLines += 1; fileOut.write(line + '\n') fileOut.close() print nOfLines, 'lines recorded.'
line = fileIn.readline() cods = falsesDict.keys() cods.sort() print '='*40 print 'Histogram for falses from filters:' print '='*40 for cod in cods: print '%2dx %d:%s' %(falsesDict[cod],cod, filters.getMessageStrFromFilterReturnNumberCode(cod)) print '-'*40 percentOfOks = nOfOks * 100 / (0.0 + c) print 'Total', c, ':: ok/total = %5.2f' %(percentOfOks), '%' def processChain2(): nOfCoincIn=3 chainLevel2toApostas(Sena.getNOfLastJogo()+1, nOfCoincIn) putInAscendingOrderInFile() def processChain(): doCombinations() chainLevel1to2() nOfCoincIn=3 chainLevel2toApostas(Sena.getNOfLastJogo()+1, nOfCoincIn) putInAscendingOrderInFile() if __name__ == '__main__': print 'Sena.getNOfLastJogo()', Sena.getNOfLastJogo() print 'Running updateDataFiles()' updateDataFiles()
def pickUpDezenasWithHg2(orders): orders = [1, 4, 6, 8] for order in range(32): hg2Obj = atualizaStatisticsEtAl.DezenasHGSingleton() hg2Obj.setNDoJogo(Sena.getNOfLastJogo()) ds = hg2Obj.getDezenasWithOrderOfFreq(order)