摘要: 1. 选择排序----def selectSort(l): for i in range(len(l)): j = i + 1 t_min = l[i] loc_min = i for j in range(j,len(l)): ... 阅读全文
posted @ 2014-11-28 10:43 AlexBai326 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 本文章转自kenby的博客,比较全面易懂,转来留作以后使用。http://kenby.iteye.com/blog/1162698一、从一个使用场景开始import logging# 创建一个loggerlogger = logging.getLogger('mylogger')logger.set... 阅读全文
posted @ 2014-11-27 09:56 AlexBai326 阅读(244) 评论(0) 推荐(0) 编辑
摘要: --官方API文档,中文版http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html-以后会把常用的摘录出来 阅读全文
posted @ 2014-11-20 14:46 AlexBai326 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 最近想学习自动化测试--web元素的匹配查找,一直搞不懂CSS的相关标签与对元素的渲染方式。本文转自W3School:http://www.w3school.com.cn/css/css_howto.asp层叠次序当同一个 HTML 元素被不止一个样式定义时,会使用哪个样式呢?一般而言,所有的样式会... 阅读全文
posted @ 2014-11-18 11:13 AlexBai326 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 正则表达式prog = re.compile(pattern)result = prog.match(string)pattern:正则表达式内容string:使用正则表达式去匹配的字符串re.compile(pattern)返回一个regular expression object,可使用rege... 阅读全文
posted @ 2014-11-11 21:54 AlexBai326 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Python文件IO有如下文本内容,文件路径为D:\temp,文件名称为lyric.txt,line1 Look ! line2 If U had one shotline3 One opportunityline4 To seize everything U ever wantedline5 On... 阅读全文
posted @ 2014-11-10 23:45 AlexBai326 阅读(211) 评论(0) 推荐(0) 编辑
摘要: lock 对象: acquire():负责取得一个锁。如果没有线程正持有锁,acquire方法会立刻得到锁。否则,它闲意态等锁被释放。 一旦acquire()返回,调用它的线程就持有锁。 release(): 释放锁。如果有其他线程正等待这个锁(通过acquire()),当rele... 阅读全文
posted @ 2014-11-03 15:15 AlexBai326 阅读(164) 评论(0) 推荐(0) 编辑
摘要: In Python 3 unicode strings are the 'regular strings' (str) and byte strings are separate objects.Low level I/O can be done only with data (byte strin... 阅读全文
posted @ 2014-10-30 17:01 AlexBai326 阅读(1039) 评论(0) 推荐(0) 编辑
摘要: socket send(),recv()makefile()udp通信不几乎不使用文件类对象,因为他们往往不能为数据如何发送和接收提供足够的控制Python的socket模块4种异常:与一般I/0和通信问题有关的socket.error与查询地址信息有关的socket.gaierror与其他地址错误... 阅读全文
posted @ 2014-10-29 11:18 AlexBai326 阅读(159) 评论(0) 推荐(0) 编辑
摘要: boolean类型转化为stringboolean b = true;String s = String.valueOf(b);System.out.println(s); 阅读全文
posted @ 2014-03-06 09:18 AlexBai326 阅读(1336) 评论(0) 推荐(0) 编辑