本月博客排行
-
第1名
wy_19921005 -
第2名
mft8899 -
第3名
java-007 - Anmin
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
benladeng5225 - wy_19921005
- vipbooks
- 青否云后端云
- kaizi1992
- e_e
- tanling8334
- sam123456gz
- arpenker
- zysnba
- fantaxy025025
- xiangjie88
- wallimn
- lemonhandsome
- jh108020
- ganxueyun
- Xeden
- zhanjia
- xyuma
- wangchen.ily
- johnsmith9th
- zxq_2017
- forestqqqq
- jbosscn
- daizj
- ajinn
- xpenxpen
- 喧嚣求静
- kingwell.leng
- lchb139128
- kristy_yy
- jveqi
- javashop
- lzyfn123
- sunj
- yeluowuhen
- lerf
- silverend
- chenqisdfx
- xiaoxinye
- flashsing123
- bosschen
- lyndon.lin
- zhangjijun
- sunnylocus
- lyj86
- paulwong
- sgqt
最新文章列表
python中executemany和序列的应用
一 代码
import sqlite3
persons=[
("Jim","Green"),
("Hu","jie")
]
conn=sqlite3.connect(":memory:")
conn.execute("CREATE TABLE pers ...
python中executemany和生成器的应用
一 代码
import sqlite3
import string
def char_generator():
for c in string.ascii_lowercase:
yield(c)
conn=sqlite3.connect(":memory:")
cur=conn.cursor()
cur.execute("CRE ...
python中executemany和迭代器的应用
一 代码
import sqlite3
class IterChars:
def __init__(self):
self.count = ord('a')
def __iter__(self):
return self
def __next__(self):
if self.count>ord('z') ...
python中MySQLdb的execute和executemany的使用
如果使用executemany对数据进行批量插入的话,要注意一下事项:
conn = MySQLdb.connect(host = “localhost”, user = “root”, passwd = “password”, db = “myDB”, charset=’utf8′)
cursor = conn.cursor()
sql = “insert into myTable (creat ...