上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页
摘要: # -*-encoding:utf8-*-import reimport requestsimport sysreload(sys)sys.setdefaultencoding('utf8')class craw... 阅读全文
posted @ 2016-03-28 15:17 cn_wk 阅读(68) 评论(0) 推荐(0)
摘要: 今天做网页到了测试和数据库交互的地方,其中HTML和数据库都是设置成utf-8格式编码,插入到数据库中是正确的,但是当读取出来的时候就会出错,原因就是python的str默认是ascii编码,和unicode编码... 阅读全文
posted @ 2016-03-28 10:47 cn_wk 阅读(79) 评论(0) 推荐(0)
摘要: 脚本:#!/usr/bin/python dict={"a":"apple","b":"banana","o":"orange"} print "##########dict##################... 阅读全文
posted @ 2016-03-28 10:44 cn_wk 阅读(100) 评论(0) 推荐(0)
摘要: 现在大部分高级语言都支持“?”这个三元运算符(ternary operator),它对应的表达式如下:condition ? value if true : value if false。很奇怪的是,这么... 阅读全文
posted @ 2016-03-28 10:42 cn_wk 阅读(365) 评论(0) 推荐(0)
摘要: 本文环境:Python 2.7 一个类的三个对象实例的属性被同时修改有段代码如下:class task_queue: queue=[] def append(self,obj): ... 阅读全文
posted @ 2016-03-27 12:48 cn_wk 阅读(77) 评论(0) 推荐(0)
摘要: 语言规范:http://zh-google-styleguide.readthedocs.org/en/latest/google-python-styleguide/python_language_rules/... 阅读全文
posted @ 2016-03-27 12:41 cn_wk 阅读(69) 评论(0) 推荐(0)
摘要: 解读Python内存管理机制2010-07-23 09:34 Robert Chen 网络转载 字号:T | T内存管理,对于Python这样的动态语言,是至关重要的一部分,它在很大程度上甚至决定了Python的... 阅读全文
posted @ 2016-03-26 19:11 cn_wk 阅读(53) 评论(0) 推荐(0)
摘要: 注:本文的原文是 5 Great Python Interview Questions,同时谢谢 @非乌龟 指出我的疏漏,没有来源标记,也赞其细心,希望看文章的同时大家都能看下原文,因为每个人的理解不一致,原汁原... 阅读全文
posted @ 2016-03-26 15:12 cn_wk 阅读(60) 评论(0) 推荐(0)
摘要: NPM小结nodejs的出现,可以算是前端里程碑式的一个事件,它让前端攻城狮们摆脱了浏览器的束缚,踏上了一个更加宽广的舞台。前端的可能性,从此更加具有想象空间。随着一系列基于nodes的应用/工具的出现,工作中与... 阅读全文
posted @ 2016-03-25 18:34 cn_wk 阅读(108) 评论(0) 推荐(0)
摘要: easy_insall的作用和perl中的cpan, ruby中的gem类似,都提供了在线一键安装模块的傻瓜方便方式;pip是easy_install的改进版, 提供更好的提示信息,删除package等功能。老版... 阅读全文
posted @ 2016-03-25 18:20 cn_wk 阅读(59) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页