随笔分类 - 随手练习
摘要:import openpyxl from openpyxl import Workbook from openpyxl.drawing import image from openpyxl.styles import PatternFill, Border, Side, Alignment, Pro
阅读全文
摘要:微信接口 wzhifuSDK- 由微信支付SDK 官方PHP Demo移植而来,v3.37下载地址 weixin_pay- 是一个简单的微信支付的接口 weixin_pay- 微信支付接口(V3.3.7)类库。此类库目前只提供了三种接口的操作类:①统一支付接口②订单查询接口③JSAPI 支付 wxp
阅读全文
摘要:由于python中默认的编码是ascii,如果直接使用open方法得到文件对象然后进行文件的读写,都将无法使用包含中文字符(以及其他非ascii码字符),因此建议使用utf-8编码。为了避免读写错误,可以直接使用codecs模块。读下面的代码读取了文件,将每一行的内容...
阅读全文
摘要:#encoding=utf-8 #文件比较小 count=len(open(r"data.txt",'r').readlines()) print(count) #文件比较大 count=-1 for count, line in enumerate(...
阅读全文
摘要:正则表达式re.S的用法在Python的正则表达式中,有一个参数为re.S。它表示“.”(不包含外侧双引号,下同)的作用扩展到整个字符串,包括“\n”。看如下代码:import rea = '''asdfsafhellopass: 234455 world...
阅读全文
摘要:import randomimport collectionsimport string#str1 = '赵钱孙李周吴郑王'str1 = string.ascii_uppercase # 大写 ABCDEFGHIJKLMNOPQRSTUVWXYZ#str1 = st...
阅读全文

浙公网安备 33010602011771号