标签:mysq nbsp list logs log name insert exe value
d = {‘name‘:‘alx‘,‘age‘:18,‘pp‘:11,‘cc‘:12} sql = ‘‘‘insert into xx(%s) value(%s)‘‘‘ key_list = [] value_list=[] for k,v in d.items(): key_list.append(k) value_list.append(‘%%(%s)s‘ % k) sql = sql % (‘,‘.join(key_list),‘,‘.join(value_list)) cursor.execute(sql,d)
标签:mysq nbsp list logs log name insert exe value
原文地址:http://www.cnblogs.com/Erick-L/p/6863901.html