上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页
摘要: 1.low版线程池设计思路:运用队列queue 将线程类名放入队列中,执行一个就拿一个出来import queueimport threading class ThreadPool(object): def __init__(self, max_num=20): self.queue = queue 阅读全文
posted @ 2017-10-31 10:11 任飞儿 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1、进程与线程优、缺点的比较总言:使用进程和线程的目的,提高执行效率。 进程: 优点:能利用机器的多核性能,同时进行多个操作。 缺点:需要耗费资源,重新开辟内存空间,耗内存。 线程: 优点:共享内存(资源),做IO操作时,可以创造并发操作。 缺点:抢占资源。 总结:进程并不是越多越好,最好CPU个数 阅读全文
posted @ 2017-10-30 16:09 任飞儿 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Python中,专门用于HTML/XML解析的库; 特点是: 即使是有bug,有问题的html代码,也可以解析。 BeautifulSoup主要有两个版本 BeautifulSoup 3 之前的,比较早的,是3.x的版本。 BeautifulSoup 3的在线文档 最新的,可用的,在线文档是: ht 阅读全文
posted @ 2017-10-27 17:52 任飞儿 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 自python2.6开始,新增了一种格式化字符串的函数str.format() 语法 它通过{}和:来代替%。 “映射”示例 通过位置 字符串的format函数可以接受不限个参数,位置可以不按顺序,可以不用或者用多次,不过2.6不能为空{},2.7才可以。 通过关键字参数 通过对象属性 通过下标 有 阅读全文
posted @ 2017-10-27 10:46 任飞儿 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 获取标签名 h1 class 是h1usersoup.find(name="h1", attrs={"class":"h1user"});获取标签的内容h1userSoup.string; __str__ 使用class Student(object): def __init__(self, nam 阅读全文
posted @ 2017-10-26 17:25 任飞儿 阅读(574) 评论(0) 推荐(0) 编辑
摘要: SQLite中的时间日期函数这是我学习SQLite时做的笔记,参考并翻译了Chris Newman写的《SQLite》中的《Working with Dates and Times》部分内容。SQLite包含了如下时间/日期函数:datetime().......................产生 阅读全文
posted @ 2017-10-26 14:18 任飞儿 阅读(285) 评论(0) 推荐(0) 编辑
摘要: cx = sqlite3.connect("c:/数据库地址") # 打开数据库cu = cx.cursor()# delete the rowcu.execute("delete from user where username=='majuan'")# Save (commit) the cha 阅读全文
posted @ 2017-10-25 15:24 任飞儿 阅读(570) 评论(0) 推荐(0) 编辑
摘要: cx = sqlite3.connect("c:/数据库地址") # 打开数据库cu = cx.cursor()# query the tablerows = cu.execute("select * from user")# print the tablefor row in rows: prin 阅读全文
posted @ 2017-10-25 15:19 任飞儿 阅读(377) 评论(0) 推荐(0) 编辑
摘要: cx = sqlite3.connect("c:/数据库名字")#打开数据库cu = cx.cursor()cu.execute("INSERT INTO [user] VALUES('乔任梁', '123', '123','测试','122','111')")#新增sqlcx.commit() 阅读全文
posted @ 2017-10-25 14:14 任飞儿 阅读(621) 评论(0) 推荐(0) 编辑
摘要: .NET Framework 3.5的新特性 Language Integrated Query,即语言集成查询 查询 和语言结合关系数据库里的信息使用的XML文档保存在本地的DataSet内存中的List列表 LINQ中最基本的数据单元是sequences和elements。一个sequence是 阅读全文
posted @ 2017-10-24 09:33 任飞儿 阅读(162) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页