![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python 工作学习
文章平均质量分 54
OneMemory
这个作者很懒,什么都没留下…
展开
-
python 判断带路径的文件是否存在,否则创建
file_dir = os.path.split(logfilename)[0] if not os.path.isdir(file_dir): os.makedirs(file_dir) if not os.path.exists(logfilename): os.system(r'touch %s' % logfilename)原创 2014-10-10 18:33:28 · 23627 阅读 · 0 评论 -
获取URL中的一级域名
对网络数据的处理中,常常用到对url进行分类,在内存中建立字典,以一级域名作为键,是很好的分类方式;苦于对于一级域名的提取,这里写了个小工具,要是还有更好的方法,请大家分享原创 2015-10-16 11:29:12 · 7345 阅读 · 1 评论 -
unittest流程
unittest源代码研究后写的类图原创 2017-01-23 17:30:16 · 682 阅读 · 0 评论