# data input from php : $length $part ($exer_type $trainer $equipment) $timing $level from rcmd_func import dbConnection as database from rcmd_func import youtube_api as YT from rcmd_func import dataProcessor import random import pandas as pd import numpy as np import sys import time MyDB = database.MyDB('address', port, 'id', 'pw', 'db_name') def main(length, bodypart, excer_type, trainer, equipment, timing, level): # convert string to list type # 5, 10, 15, 20, 40, 60 length = int(length) if length == 5: front_length = 0 end_length = 6 elif length == 10: front_length = 7 end_length = 12 elif length == 15: front_length = 13
from rcmd_func import dbConnection as database import sys import random import time MyDB = database.MyDB('115.68.99.11', 3306, 'ksunk', '!@ksunk', 'ksunkDB') def main(theme_num): lowLevel_rcmd_list = [] midLevel_rcmd_list = [] highLevel_rcmd_list = [] # ========= select video_dictionary having same attribute ===================== for i in range(4): step_num = i + 1 MyDB.dic_execute( 'select length, timing, bodypart, excer_type, equipment from DETAILSTEP where theme_num = %s and step_num = %s' % (str(theme_num), str(step_num))) video_attribute = MyDB.dic_fetchone() length_i = video_attribute['length'] length_list = range(length_i - 5, length_i + 5, 1) bodypart_list = video_attribute['bodypart'].split(',') excer_type_list = video_attribute['excer_type'].split(',') equipment_list = video_attribute['equipment'].split(',')