2021
03-16
03-16
python sqlite3 判断cursor的结果是否为空的案例
len(list(cursor))若是0则为空举例:importsqlite3#CREATEdb=sqlite3.connect("E:/Pycharm/workspace/django_test/user.db")db.execute("createtableuser(infoprimarykey,flag,result)")db.execute("insertintouser(info,flag,result)values('RikkaTakanashi','0','DarkFlameMaster')")db.commit()db.close()db=sqlite3.connect("E:/Pycharm/workspace/django_test/user.db")c=db.cursor()cursor=c.execute("s...
继续阅读 >