代码拉取完成,页面将自动刷新
import pymysql
class store:
coon = None
def init():
store.coon = pymysql.connect(
host = '127.0.0.1',
user = 'root',
password = 'Qing0815!',
db = 'tomorrow',
charset = 'utf8',
cursorclass = pymysql.cursors.DictCursor
)
def save(info):
try:
with store.coon.cursor() as cursor: # 执行完毕返回的结果集默认以元组显示
cursor.executemany('insert into content (title,text) values(%s,%s)',info) #执行SQL语句
store.coon.commit() #提交
return True
except:
return False
#cursor.close() #关闭光标对象
#store.coon.close() #关闭SQL连接
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。