conn = get_conn(sqlite_path+os.sep+dbfile) table_sql = "select name from sqlite_master where type='table' order by name" cu = get_cursor(conn) cu.execute(table_sql) tablenames = cu.fetchall() # print('tablenames:',tablenames) # [('sh600152',), ('sh600228',),..] for symbol_table in tablenames: fetchall_sql = '''SELECT * FROM ''' + symbol_table[0] + """ where((strftime("%H",time)='09')and(strftime("%M",time)>='30')and(strftime("%M",time)<'31'))""" print(fetchall_sql) cu.execute(fetchall_sql) data = cu.fetchall() print (data)
python sqlite 时间查询
最新推荐文章于 2024-12-10 09:28:58 发布
1480

被折叠的 条评论
为什么被折叠?



