摘要: ###经常看到源码里面有相关的日志操作特地整理一下 基础知识 from io import StringIO #StringIO模块主要用于在内存缓冲区中读写数据 s = StringIO() s.write("www.baidu.com\n") s.write("www.google.com") 阅读全文
posted @ 2020-07-08 18:23 该显示昵称已被使用了 阅读(834) 评论(0) 推荐(0) 编辑
摘要: 闭包:一个持有外部环境变量的函数就是闭包;闭包是一个能够访问其他函数作用域的函数 ''' 简化写法 ''' def multipliers(): return [lambda x: i * x for i in range(4)] print([m(2) for m in multipliers() 阅读全文
posted @ 2020-07-08 15:51 该显示昵称已被使用了 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 汇总 # 0. 装饰器的参数 @deprecated(1,2) # 参数是1,2 def a_test(): pass @deprecated # 参数是下面的函数 def a_test(): pass def deprecated(substitute, hint=SSH_PROCESS_HINT 阅读全文
posted @ 2020-07-08 11:39 该显示昵称已被使用了 阅读(145) 评论(0) 推荐(0) 编辑
摘要: get post # 1 https://restapi.amap.com/v3/geocode/geo?address=北京市朝阳区阜通东大街6号&output=XML&key=<用户的key> https://lbs.amap.com/api/webservice/guide/api/geore 阅读全文
posted @ 2020-07-08 11:30 该显示昵称已被使用了 阅读(525) 评论(0) 推荐(0) 编辑
摘要: python解析XML,HTML # 1 from lxml import etree # 2 import xml.dom.minidom # 3 bs4 # 4 import xmltodict python读取文件共享 ''' https://pypi.org/project/smbproto 阅读全文
posted @ 2020-07-08 10:39 该显示昵称已被使用了 阅读(187) 评论(0) 推荐(0) 编辑