1 Star 1 Fork 0

LeoKim / diff

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
up_diff.py 854 Bytes
一键复制 编辑 原始数据 按行查看 历史
LeoKim 提交于 2018-07-06 18:24 . update
# -*-coding:utf-8 -*-
#author: LeoKim
import pymysql
import configparser
conf = configparser.ConfigParser()
conf.read('config.ini')
#连接数据库
conn = pymysql.connect(
host = conf.get('config', 'host'),
user = conf.get('config', 'user'),
password = conf.get('config', 'password'),
database = conf.get('config', 'database'),
charset = conf.get('config', 'charset'),
cursorclass = pymysql.cursors.DictCursor
)
def update_files(floder, md5_f1, f1_size, md5_f2, f2_size, md5):
cursor = conn.cursor()
sql = "update files set floder = '"+floder+"', md5_f1 = '"+md5_f1+"', f1_size = '"+str(f1_size)+"', md5_f2 = '"+md5_f2+"', f2_size = '"+str(f2_size)+"' where md5 = '"+md5+"'"
cursor.execute(sql)
conn.commit()
cursor.close()
#关闭了这个conn 主文件里的conn也就关闭了
# conn.close()
1
https://gitee.com/iamleokim/diff.git
git@gitee.com:iamleokim/diff.git
iamleokim
diff
diff
master

搜索帮助