import sqlite3 # '''创建一个数据库,文件名''' # 如果给定的数据库名称 filename 不存在,则该调用将创建一个数据库 conn = sqlite3.connect("/Users/mac/Desktop/Trace20190523.db") # '''创建游标''' cursor = conn.cursor() # 查询所有的信息 sql = '''select * from k_trace_log ''' # 执行语句 results = cursor.execute(sql) # 遍历打印输出 all_students = results.fetchall() for student in all_students: print(student)
Python操作SQLLite--查询数据
猜你喜欢
转载自www.cnblogs.com/hhmm99/p/10914866.html
今日推荐
周排行