- 博客(10)
- 收藏
- 关注
转载 统一TXT文件格式
from collections import Counterimport jiebaimport jieba.possegfrom jieba import analyseimport sys#jieba.suggest_freq('乡村小规模学校', True)import reimport importlibimport linecache...
2019-09-04 09:02:00
402
转载 getTable
import pymysqlimport xlrdimport reimport linecacheimport docximport sysimport docxfrom docx import Document #导入库import prettytable as ptimport xlwt#连接数据库try: ...
2019-08-19 08:52:00
345
转载 根据指定id获取需要的正则内容
import pymysqlimport re# import wenjianduqudef getResult(x,y):sql=cursor.execute("select regular from regular where regular_id=%d"%x)regular=cursor.fetchmany(sql)#获取查询结果Regular=eval...
2019-08-13 16:42:00
245
转载 获取文件中表格并按表格形式输出
import reimport linecacheimport docximport sysimport docxfrom docx import Document #导入库import prettytable as ptimport xlrdimport xlwtpath = "D:\\文件\\政策汇\\有用\\untitled3\\docx...
2019-08-13 16:35:00
180
转载 时间格式统一
def data2digit(text):if '年' in text:year = text.split('年')[0]month = text.split('年')[1].split('月')[0]day = text.split('月')[1].split('日')[0]elif '月' in text:year = 0month = text.sp...
2019-08-07 14:52:00
133
转载 时间转换(中文转数字)
#中文时间转换为****-**-**格式def chinese2digit(text):""""中文日期转换为数字日期"""# 注意:输入格式必须是 二〇一二年十月十一日 年份不能写 两千零一二chinese_to_digit_table = {'零':0, 'O':0, 'Ο':0, 'О':0, '○':0, 'O': 0, '0':0, '〇': 0, '一':...
2019-08-07 14:51:00
654
转载 获取docx文件中表格的内容
# -*- coding: UTF-8 -*-import reimport linecacheimport docximport sysimport docxfrom docx import Document #导入库path = "D:\\文件\\政策汇\\有用\\untitled3\\docx\\printout.docx" #文件路径...
2019-08-07 09:22:00
663
转载 从指定地址获取文件进行正则匹配,输出至指定表格
import pymysqlimport reconn = pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',db='test',charset='utf8',)cursor = conn.cursor()f = open('D:\\文件\\政策汇\...
2019-08-05 17:14:00
127
转载 遍历ID从数据库获得需要的数据
import pymysqlimport reimport linecacheconn = pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',db='test',charset='utf8',)cursor = conn.cursor()sql1...
2019-08-02 10:31:00
601
转载 python实现将txt文件内容存入mysql数据库中
import pymysql#连接数据库conn = pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',db='test',charset='utf8',)cursor = conn.cursor()f = open('C:\\Users\\zyl\\D...
2019-08-02 08:45:00
1633
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人