This article mainly introduces relevant information on the detailed explanation of the use of executemany and sequence in python. Friends in need can refer to the following
Detailed explanation of the use of executemany and sequence in python
One code
##
import sqlite3 persons=[ ("Jim","Green"), ("Hu","jie") ] conn=sqlite3.connect(":memory:") conn.execute("CREATE TABLE person(firstname,lastname)") conn.executemany("INSERT INTO person(firstname,lastname) VALUES(?,?)",persons) for row in conn.execute("SELECT firstname,lastname FROM person"): print(row) print("I just deleted",conn.execute("DELETE FROM person").rowcount,"rows")
Two running results
y ======== ('Jim', 'Green') ('Hu', 'jie') I just deleted 2 rows
The above is the detailed content of Detailed explanation of examples of executemany and sequence in python. For more information, please follow other related articles on the PHP Chinese website!