
python-工具
r_rmax
这个作者很懒,什么都没留下…
展开
-
使用python对excle和json互相转换
python 版本:2.7只是读取excel的话可以直接使用xlrd1.excle to json代码如下# -*-coding:utf8 -*-import xlrdfrom collections import OrderedDictimport jsonimport codecsfile_name=raw_input('请输入要转换的excle文件路径:')wb = xlrd.open_wo...原创 2018-02-28 15:27:20 · 2481 阅读 · 0 评论 -
如何把类似json格式的字符串处理成标准的json
环境:Python3 ,Ubuntu16一。代码如下:def to_json(str_near): ''' 处理不标准的json ''' use_str = eval(str_near,type('Dummy',(dict,),dict(__getitem__=lambda s ,n:n))()) return use_strif __name__ = "__main...原创 2018-03-19 15:01:32 · 2939 阅读 · 0 评论 -
使用python起名
原文链接:http://www.pengshiyu.com/chinesename/中文取名说明项目包含了常用于名字的2812个汉字,常用的姓氏504个pypi地址: https://pypi.python.org/pypi/chinesename安装模块pip install chinesename代码示例:>>> from chinesename import chines...转载 2018-03-19 17:44:46 · 4577 阅读 · 0 评论 -
使用python3 发送邮件
环境:python3, win101.直接上代码:import smtplibfrom email.header import Headerfrom email.mime.text import MIMEText# 第三方 SMTP 服务mail_host = "smtp.163.com" # SMTP服务器mail_user = "*****@163.com" # 用户名mail_pass ...原创 2018-03-27 10:23:53 · 567 阅读 · 0 评论 -
python切图并识别图片中的文字
某些图片化数据,想要批量处理成文字信息。可以使用python的PiL库。一.环境win 10 python 3.6 anaconda二.切图from PIL import Imageimport pytesseractdef cut_image(fiel_path): img = Image.open(fiel_path) region = (0,0,100,200) ...原创 2018-05-03 15:43:29 · 1740 阅读 · 0 评论 -
for 循环显示进度条
环境py3.5win10 from tqdm import tqdmimport timefor i in tqdm(range(10)): time.sleep(1)print('')print('complete....')原创 2018-05-14 17:14:17 · 2575 阅读 · 0 评论