美文网首页
python sqlite

python sqlite

作者: 李绍俊 | 来源:发表于2018-03-27 22:42 被阅读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}')
            
    

    相关文章

      网友评论

          本文标题:python sqlite

          本文链接:https://www.haomeiwen.com/subject/yrjecftx.html