12 2017 档案
python3中的zip函数(转)
摘要:原文地址:https://www.cnblogs.com/qqhfeng/p/5267352.html 在window,显示变量 print(x);而在linux中 print x 例如,有两个列表: 使用zip()函数来可以把列表合并,并创建一个元组对的列表。 >>> zip(a,b)<zip o 阅读全文
posted @ 2017-12-31 20:53 睡着的糖葫芦 阅读(160) 评论(0) 推荐(0)
python requests的content和text方法的区别(转)
摘要:原文地址: http://blog.csdn.net/xie_0723/article/details/51361006 问题: 结论是: 也就是说,如果你想取文本,可以通过r.text。 如果想取图片,文件,则可以通过r.content。 (resp.json()返回的是json格式数据) 举个栗 阅读全文
posted @ 2017-12-28 14:51 睡着的糖葫芦 阅读(10096) 评论(0) 推荐(0)
解决python3 UnicodeEncodeError: 'gbk' codec can't encode character '\xXX' in position XX(转)
摘要:原文地址:https://www.cnblogs.com/feng18/p/5646925.html 从网上抓了一些字节流,想打印出来结果发生了一下错误: UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in positio 阅读全文
posted @ 2017-12-25 20:11 睡着的糖葫芦 阅读(545) 评论(0) 推荐(0)
Python语言特性之3:@staticmethod和@classmethod
摘要:问题:Python中@staticmethod和@classmethod两种装饰器装饰的函数有什么不同? 原地址:http://stackoverflow.com/questions/136097/what-is-the-difference-between-staticmethod-and-cla 阅读全文
posted @ 2017-12-21 14:10 睡着的糖葫芦 阅读(271) 评论(0) 推荐(0)
Linux 按时间批量删除文件(删除N天前文件)
摘要:需要根据时间删除这个目录下的文件,/home/lifeccp/dicom/studies,清理掉20天之前的无效数据。 可以使用下面一条命令去完成: 这个是根据时间删除。 下面简要解释一下,这句shell命令: find /home/lifeccp/dicom/studies -mtime +21 阅读全文
posted @ 2017-12-12 13:10 睡着的糖葫芦 阅读(1851) 评论(0) 推荐(0)
简述 OAuth 2.0 的运作流程(转)
摘要:原文地址:http://www.barretlee.com/blog/2016/01/10/oauth2-introduce/ 本文将以用户使用 github 登录网站留言为例,简述 OAuth 2.0 的运作流程。 假如我有一个网站,你是我网站上的访客,看了文章想留言表示「朕已阅」,留言时发现有这 阅读全文
posted @ 2017-12-06 17:02 睡着的糖葫芦 阅读(203) 评论(0) 推荐(0)