Commit a60bd8b6 authored by 张彦钊's avatar 张彦钊

add while circle in test py

parent 5fcbe5f7
......@@ -12,10 +12,11 @@ def con_sql(sql):
return df
if __name__ == "__main__":
now = datetime.now()
now_start = str(now)[:16] + ":00"
now_end = str(now)[:16] + ":59"
sql = "select device_id from user_active_time " \
"where active_time <= '{}' and active_time >= '{}'".format(now_end, now_start)
df = con_sql(sql)
print(df.head(1))
\ No newline at end of file
while True:
now = datetime.now()
now_start = str(now)[:16] + ":00"
now_end = str(now)[:16] + ":59"
sql = "select device_id from user_active_time " \
"where active_time <= '{}' and active_time >= '{}'".format(now_end, now_start)
df = con_sql(sql)
print(df.head(1))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment