会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
orangeYY
博客园
首页
新随笔
联系
管理
订阅
2019年9月4日
统一TXT文件格式
摘要: from collections import Counter import jieba import jieba.posseg from jieba import analyse import sys #jieba.suggest_freq('乡村小规模学校', True) import re i
阅读全文
posted @ 2019-09-04 09:02 orangeYY
阅读(662)
评论(0)
推荐(0)
2019年8月19日
getTable
摘要: import pymysql import xlrd import re import linecache import docx import sys import docx from docx import Document #导入库 import prettytable as pt impor
阅读全文
posted @ 2019-08-19 08:52 orangeYY
阅读(640)
评论(0)
推荐(0)
2019年8月13日
根据指定id获取需要的正则内容
摘要: import pymysql import re # import wenjianduqu def getResult(x,y): sql=cursor.execute("select regular from regular where regular_id=%d"%x) regular=curs
阅读全文
posted @ 2019-08-13 16:42 orangeYY
阅读(410)
评论(0)
推荐(0)
获取文件中表格并按表格形式输出
摘要: import re import linecache import docx import sys import docx from docx import Document #导入库 import prettytable as pt import xlrd import xlwt path = "
阅读全文
posted @ 2019-08-13 16:35 orangeYY
阅读(256)
评论(0)
推荐(0)
2019年8月7日
时间格式统一
摘要: def data2digit(text): if '年' in text: year = text.split('年')[0] month = text.split('年')[1].split('月')[0] day = text.split('月')[1].split('日')[0] elif '
阅读全文
posted @ 2019-08-07 14:52 orangeYY
阅读(359)
评论(0)
推荐(0)
时间转换(中文转数字)
摘要: #中文时间转换为****-**-**格式 def chinese2digit(text): """"中文日期转换为数字日期""" # 注意:输入格式必须是 二〇一二年十月十一日 年份不能写 两千零一二 chinese_to_digit_table = {'零':0, 'O':0, 'Ο':0, 'О
阅读全文
posted @ 2019-08-07 14:51 orangeYY
阅读(3530)
评论(0)
推荐(0)
获取docx文件中表格的内容
摘要: # -*- coding: UTF-8 -*- import re import linecache import docx import sys import docx from docx import Document #导入库 path = "D:\\文件\\政策汇\\有用\\untitled
阅读全文
posted @ 2019-08-07 09:22 orangeYY
阅读(1104)
评论(0)
推荐(0)
2019年8月5日
从指定地址获取文件进行正则匹配,输出至指定表格
摘要: import pymysql import re conn = pymysql.connect( host='localhost', port=3306, user='root', passwd='123456', db='test', charset='utf8', ) cursor = conn
阅读全文
posted @ 2019-08-05 17:14 orangeYY
阅读(222)
评论(0)
推荐(0)
2019年8月2日
遍历ID从数据库获得需要的数据
摘要: import pymysql import re import linecache conn = pymysql.connect( host='localhost', port=3306, user='root', passwd='123456', db='test', charset='utf8'
阅读全文
posted @ 2019-08-02 10:31 orangeYY
阅读(752)
评论(0)
推荐(0)
python实现将txt文件内容存入mysql数据库中
摘要: import pymysql #连接数据库 conn = pymysql.connect( host='localhost', port=3306, user='root', passwd='123456', db='test', charset='utf8', ) cursor = conn.cu
阅读全文
posted @ 2019-08-02 08:45 orangeYY
阅读(9486)
评论(0)
推荐(0)
公告