Example #1
0
def predictCheckThread():
    print(datetime.datetime.now(), ": Check Predicted Numbers")

    thisTime = GlobalMethod.getthisTime()
    # 이번 예상 번호가 없으면,없을경우 false
    if not (helpers.check_predictedData(thisTime)):
        #     로또 origin 데이터 먼저 받았는지 확인
        GlobalMethod.db_checkOriginData(thisTime - 1)

        # 예상번호 생성
        result = {}
        for i in numsList:
            result[i] = Lotto.getPredict(i)
        result = json.dumps(result)

        helpers.add_predictedData(thisTime, datetime.datetime.now(),
                                  Lotto.learning_rate, Lotto.steps, result)

    # 한번 더 검사
    if not (helpers.check_predictedData(thisTime)):
        print("scripts-init Error")
        quit()

    #     1시간마다 가동
    threading.Timer(3600, predictCheckThread).start()
Example #2
0
def api_nums10():
    today = str(GlobalMethod.getToday())
    dDay = str(GlobalMethod.getDDay())
    thisTime = str(GlobalMethod.getthisTime())
    data = str(helpers.dbGetPredictedData(thisTime, 10))

    return jsonify(today=today, dDay=dDay, thisTime=thisTime
                   , data=data)
Example #3
0
# -*- coding:utf-8 -*-

import tensorflow.compat.v1 as tf
import numpy as np
import datetime, ssl
from items import GlobalMethod
from scripts import helpers

tf.disable_v2_behavior()

today = GlobalMethod.getToday()
dDay = GlobalMethod.getDDay()
thisTime = GlobalMethod.getthisTime()
learning_rate = 0.05
steps = 10000


# nums받으면 회차 구해주기
def numsToTimeAndDays(nums):

    # 원하는 숫자만큼 회차로
    if nums == 1000: nums = thisTime - 1
    timeResult = []
    daysResult = []
    for i in range(nums):
        timeResult.append(thisTime - (i + 1))
        daysResult.append((dDay - datetime.timedelta(weeks=i + 1)).isoformat())

    return [timeResult, daysResult]