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

add while circle in test py

parent 5fcbe5f7
...@@ -12,10 +12,11 @@ def con_sql(sql): ...@@ -12,10 +12,11 @@ def con_sql(sql):
return df return df
if __name__ == "__main__": if __name__ == "__main__":
now = datetime.now() while True:
now_start = str(now)[:16] + ":00" now = datetime.now()
now_end = str(now)[:16] + ":59" now_start = str(now)[:16] + ":00"
sql = "select device_id from user_active_time " \ now_end = str(now)[:16] + ":59"
"where active_time <= '{}' and active_time >= '{}'".format(now_end, now_start) sql = "select device_id from user_active_time " \
df = con_sql(sql) "where active_time <= '{}' and active_time >= '{}'".format(now_end, now_start)
print(df.head(1)) df = con_sql(sql)
\ No newline at end of file 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