cur.execute("SELECT session_date FROM sessions WHERE ip=? ORDER BY session_date DESC LIMIT 1", (ip,))
print("=============== cur.fetchone(): ", cur.fetchone())
print("========================= type: ", type(cur.fetchone()))
return cur.fetchone()
def uniqueize(ipList):
unique_list = []
for ip in ipList:
if ip not in unique_list:
unique_list.append(ip)
print(ip)
for ip in unique_list:
session_data = (ip, int(time.time()))
print("===== unique ip ====== ", ip)
last_time = get_session_last_time_by_ip(ip)
if last_time is None:
print('No time')
store_session(sqliteConnection, session_data)
else:
print('************** GOT TIME')
last_time = int(last_time[0])
print("----------------- last_time: ", last_time)
print("---------------------- type: ", type(last_time))
Ты же понимаешь, что 3 раза делаешь fethone и он три раза разные строки возвращает?
Обсуждают сегодня