Live2D
摘要: 当python出现这种UnicodeEncodeError: 'gbk' codec can't encode character '\xb2' in position 7: illegal multibyte sequence 报错的原因是Python中的print内置方法为“utf-8”,所以解 阅读全文
posted @ 2020-05-14 15:07 鸟-叔 阅读(2399) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8from win32com.client import gencachefrom win32com.client import constants, gencachedef createPdf(wordPath, pdfPath): """ word转pdf :param 阅读全文
posted @ 2020-05-07 18:56 鸟-叔 阅读(5163) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8from docx import Documentfrom docx.shared import Ptfrom docx.shared import Inchesfrom docx.oxml.ns import qnimport docx#打开文档from urllib3. 阅读全文
posted @ 2020-05-07 16:13 鸟-叔 阅读(6425) 评论(0) 推荐(0) 编辑
摘要: def clean(string): pattern = re.compile(r'<[^>]+>', re.S) string = pattern.sub('', string) string = string.replace('\n', ' ').replace('\r', ' ').repla 阅读全文
posted @ 2020-04-21 12:28 鸟-叔 阅读(576) 评论(0) 推荐(0) 编辑
摘要: from pybloom_live import BloomFilter import pandas as pd df = pd.read_csv(fileName,encoding="utf-8") bf = pd.read_csv(capacity = df.shope[0]+100,error 阅读全文
posted @ 2020-04-08 10:28 鸟-叔 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 这种报错一般由两种情况引起: 一、函数参数为路径而非文件名, 二、函数参数带有中文 第一种的解决就是将文件名添加到路径后即可 第二种是在read_csv()方法时指定engine为Python就可以了,当然还可以先使用 with open()函数先打开在读取 pd.read_csv(read_fil 阅读全文
posted @ 2020-04-07 10:03 鸟-叔 阅读(3507) 评论(0) 推荐(0) 编辑
摘要: list1 = ['邮箱1', '邮箱2', '邮箱3']for username_recv in list1: mailserver = "smtp.163.com" # 邮箱服务器地址 username_send = '发送方邮箱名' # 邮箱用户名 password = '邮箱名' # 邮箱密 阅读全文
posted @ 2020-04-01 12:23 鸟-叔 阅读(436) 评论(0) 推荐(0) 编辑
摘要: import xlrdfrom xlrd import xldate_as_tupleimport jsonimport requestsimport datetimeimport openpyxlimport osimport timefrom bs4 import BeautifulSoupim 阅读全文
posted @ 2020-04-01 12:18 鸟-叔 阅读(4970) 评论(0) 推荐(0) 编辑
摘要: import pandas as pddef putDataIntoCsv(dataContents, fileName): save = pd.DataFrame(dataContents, columns=titles) if (os.path.exists(fileName)): file = 阅读全文
posted @ 2020-03-31 11:56 鸟-叔 阅读(793) 评论(0) 推荐(0) 编辑
摘要: 当一个很长的代码写出来之后,又一个需求来了,改了又改,发现行不通了。 当然目前有很多版本控制工具可以进行回溯,例如Git等等,但是直接比较两串代码, 或许更好一点。 https://www.diffchecker.com/ 这是一个网站可以快速甄别不同并以高亮显示。效果如下,方便实用: 阅读全文
posted @ 2020-03-06 10:00 鸟-叔 阅读(195) 评论(0) 推荐(0) 编辑