欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解python中executemany和序列的使用方法

 更新時間:2017年08月12日 11:36:55   投稿:lqh  
這篇文章主要介紹了詳解python中executemany和序列的使用方法的相關(guān)資料,需要的朋友可以參考下

詳解python中executemany和序列的使用方法

一 代碼

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") 

 二 運行結(jié)果

y ========
('Jim', 'Green')
('Hu', 'jie')
I just deleted 2 rows

以上就是python中executemany和序列的應(yīng)用,如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論