首页 > 其他 > 详细

111

时间:2017-09-01 19:32:22      阅读:252      评论:0      收藏:0      [点我收藏+]

#导入相关模块
import MySQLdb
import os
import re
#建立和mysql数据库的连接
conn = MySQLdb.connect(host=‘localhost‘,user=‘root‘,passwd=‘123lqh‘)
conn.select_db(‘slowquery‘)
curs = conn.cursor()
file=open("new2.txt")
x=()
j=()
for line in file.xreadlines():
    if ‘Count         :‘ in line:
        m=re.findall(r":(.+)",line)
        print m
    if ‘Time          :‘ in line:
        n=re.findall(r":(.+)",line)
        print n
for x in m :
    for j in n:
        print x+j

~

111

原文:http://www.cnblogs.com/linqiuhua/p/7464735.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!