python sqlite

2018-03-27  本文已影响49人  李绍俊
import sqlite3

conn = sqlite3.connect(f'./path/file_{nFileNo}.db')
print("Opened database successfully")
c = conn.cursor()
c.execute('select count(*) from tab_name where state=0')
nCount = int(c.fetchone()[0])

c.execute('select ID from tab_name where state=filter')

for a in c:
    print(f'正处理:{a[0]}, 已处理{nIndex}, 剩余{nCount-nIndex}')
        
上一篇下一篇

猜你喜欢

热点阅读