02 2019 档案

摘要:循环导出所有行和列 import pymysql,xlwtdef export_excel(table_name): host,user,passwd,db='192.168.1.152','root','myjcyf','us_sys' coon=pymysql.connect(host=host 阅读全文
posted @ 2019-02-22 11:36 小蕊-zr 阅读(211) 评论(0) 推荐(0) 编辑
摘要:批量插入时一直报错,后来发现是占位符后面忘记写分号了 从数据库删除信息 阅读全文
posted @ 2019-02-21 17:07 小蕊-zr 阅读(158) 评论(0) 推荐(0) 编辑
摘要:pymysql模块 import pymysql #1、连上数据库、账号、密码、ip、端口号、数据库 #2、建立游标 #3、执行sql #4、获取结果 #5、关闭游标 #6、连接关闭 #charest必须写utf8 FI = pymysql.connect( host='192.168.0.12',user='root',passwd='myjcyf', port=3306,db... 阅读全文
posted @ 2019-02-20 15:38 小蕊-zr 阅读(332) 评论(0) 推荐(0) 编辑
摘要:时间戳转换成格式化好的时间 格式化好的时间转换成时间戳 阅读全文
posted @ 2019-02-19 16:53 小蕊-zr 阅读(347) 评论(0) 推荐(0) 编辑
摘要:如果是单数的话只需要把 老师写的代码 阅读全文
posted @ 2019-02-18 18:25 小蕊-zr 阅读(148) 评论(0) 推荐(0) 编辑
摘要:优化代码 阅读全文
posted @ 2019-02-16 18:56 小蕊-zr 阅读(550) 评论(0) 推荐(0) 编辑
摘要:删除某目录下的空文件,如果是删除非空把==0修改为>1 删除5天前的日志文件 删除5天前的日志文件-优化 移除以.log结尾的文件 阅读全文
posted @ 2019-02-16 18:55 小蕊-zr 阅读(217) 评论(0) 推荐(0) 编辑
摘要:#1、常用的模块 os,sys,time,datetime,hashlib #2、如何导入其他目录下的模块 #3、操作数据库 OS模块 sys模块 sys.argv方法 导入一个模块的实质就是把python文件执行一次 datetime模块 TIME模块 hashlib 加密函数: hashlib 阅读全文
posted @ 2019-02-15 16:52 小蕊-zr 阅读(108) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示