猫史档案馆


【Python作品分享】kittenSQL

用户:lsk666666lsk666666查看:0 回复:4 评论:0 创建时间:2020-03-04T18:48:27


【作品展示】

center_image

 

【作品介绍】

kitten编辑器的前后端分离

依赖:

pymysql

 

【作品源代码】

import pymysql as sql


db = sql.connect("localhost","root","lsk123456","codemao")
cursor = db.cursor()
#cursor.execute("select * from codemao")
def getValue(valueId):
    cursor.execute("select * from codemao where id = " + str(valueId))
    #print(cursor.fetchall())
    data = cursor.fetchall()
    # retData = ""
    # for cell in data:
    #     for dat in cell:
    #         print(dat)
    #         retData += ","
    #         retData += str(dat)
    # print(retData)
    print(data)
    return data

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
lsk666666lsk666666

请选择性忽视所有注释。。。

 

点赞0


评论


zzy2357zzy2357

emotion_编程猫_点赞 这么实用的程序却没有人欣赏……

点赞0


评论


tq_xyytq_xyy

还行,也就是执行个SQL罢了

点赞0


评论


lsk666666lsk666666

wc,这里居然有人!!!!!!

点赞0


评论