CoderZh的技术博客
“专注、热爱、 全心贯注于你所期望的事物上,必有收获。” - 爱默生
博客园
首页
博问
闪存
联系
订阅
管理
随笔-206 文章-10 评论-1761
05 2008 档案
做人、做事,做架构师——架构师能力模型解析(转)
posted @
2008-05-31 23:06
CoderZh 阅读(502) |
评论 (0)
编辑
Python天天美味(26) - __getattr__与__setattr__
摘要: __getattr__和__setattr__可以用来对属性的设置和取值进行处理,比如下面的例子:[代码]上面的例子中,在赋值书的value属性时,偷偷的将value减去了100,呵。输出结果:Python0Python cost : 0Type is not found!Python 天天美味系列(总)Python 天天美味(24) - 初始化多维数组 Python 天天美味(25) - 深入...
阅读全文
posted @
2008-05-25 15:39
CoderZh 阅读(995) |
评论 (14)
编辑
开源Granados介绍 - SSH连接远程Linux服务器(C#)
posted @
2008-05-20 19:51
CoderZh 阅读(7283) |
评论 (60)
编辑
Python天天美味(25) - 深入理解yield
摘要: yield的英文单词意思是生产,刚接触Python的时候感到非常困惑,一直没弄明白yield的用法。本人将深入讨论Python中yield的用法。后来发现.Net也有yield关键字,恩,学习了~
阅读全文
posted @
2008-05-18 17:01
CoderZh 阅读(4591) |
评论 (7)
编辑
Python天天美味(24) - 初始化多维数组
摘要: Python中初始化一个5 x 3每项为0的数组,最好方法是:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->multilist=[[0forcolinrange(5)]forrowinrange(3)]我们知道,为了初始化一个一维数组,我们可以这样做...
阅读全文
posted @
2008-05-18 14:40
CoderZh 阅读(1913) |
评论 (6)
编辑
推荐一款非常酷的学习笔记软件 - Basket Note Pads
posted @
2008-05-18 14:05
CoderZh 阅读(3005) |
评论 (3)
编辑
Python天天美味(23) - enumerate遍历数组
摘要: 其他语言中,比如C#,我们通常遍历数组是的方法是:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->for(inti = 0; i < list.Length; i++){//todo with list[i]}在Python中,我们习惯这样遍历:...
阅读全文
posted @
2008-05-17 20:04
CoderZh 阅读(804) |
评论 (2)
编辑
Python天天美味(22) - 拷贝对象(深拷贝deepcopy与浅拷贝copy)
摘要: Python中的对象之间赋值时是按引用传递的,如果需要拷贝对象,需要使用标准库中的copy模块。1. copy.copy 浅拷贝 只拷贝父对象,不会拷贝对象的内部的子对象。2. copy.deepcopy 深拷贝 拷贝对象及其子对象一个很好的例子:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.C...
阅读全文
posted @
2008-05-17 19:49
CoderZh 阅读(1412) |
评论 (6)
编辑
Python天天美味(21) - httplib,smtplib
摘要: 例一:使用httplib访问某个url然后获取返回的内容:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->importhttplibconn=httplib.HTTPConnection("www.cnblogs.com")conn.request("...
阅读全文
posted @
2008-05-17 17:58
CoderZh 阅读(1130) |
评论 (1)
编辑
试用IronPython
posted @
2008-05-17 11:59
CoderZh 阅读(495) |
评论 (0)
编辑
Python天天美味(20) - 命令行参数sys.argv
摘要: 命令行参数是通过sys.argv[]来获取的,sys.argv[0]是代码文件本身的路径,因此参数是从1开始的。比如设置参数为: spePython代码:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->importos,sysos.system(sys...
阅读全文
posted @
2008-05-16 19:31
CoderZh 阅读(2750) |
评论 (1)
编辑
Python天天美味(19) - 时间处理datetime
摘要: Python Cook书中有很多章节都是针对某个库的使用进行介绍或是通过组合多个函数实现一些复杂的功能。我这里直接跳过了上一章节中对于文件处理的一些章节,直接进入对时间操作的章节。同时,关于datetime也是简单介绍。因为有很多东西需要自己去使用,去查帮助才最有效。例子:计算上一个星期五并输出。解答:Code highlighting produced by Actipro CodeHighli...
阅读全文
posted @
2008-05-16 19:19
CoderZh 阅读(1098) |
评论 (0)
编辑
决定学习WebLOAD
posted @
2008-05-16 16:49
CoderZh 阅读(381) |
评论 (7)
编辑
Ken Thompson爷爷的经典复制自身代码程序 - Python版本(只用两行!)
posted @
2008-05-13 08:58
CoderZh 阅读(5572) |
评论 (22)
编辑
Ken Thompson 的经典 C 程序
posted @
2008-05-13 08:51
CoderZh 阅读(949) |
评论 (2)
编辑
Python天天美味(18) - linecache.getline()读取文件中特定一行
摘要: Python中使用标准库中的linecache中的getline方法可以从某个文件中读取出特定的一行。比如:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->importlinecacheprintlinecache.getline('2.1_open....
阅读全文
posted @
2008-05-10 21:52
CoderZh 阅读(1994) |
评论 (0)
编辑
Python天天美味(17) - open读写文件
摘要: Python中文件操作可以通过open函数,这的确很像C语言中的fopen。通过open函数获取一个file object,然后调用read(),write()等方法对文件进行读写操作。1.open使用open打开文件后一定要记得调用文件对象的close()方法。比如可以用try/finally语句来确保最后能关闭文件。Code highlighting produced by Actipro C...
阅读全文
posted @
2008-05-10 17:32
CoderZh 阅读(2836) |
评论 (4)
编辑
Python天天美味(16) - 过滤字符串的技巧,map与itertools.imap
摘要: Python中的map函数非常有用,在字符转换和字符遍历两节都出现过,现在,它又出现了,会给我们带来什么样的惊喜呢?是不是要告诉我们,map是非常棒的,以后要多找它玩呢?具体的实例我们需要在目录中遍历,包括子目录(哈哈),找出所有后缀为:rmvb ,avi ,pmp 的文件。(天哪?!你要干什么?这可是我的隐私啊~~)Code highlighting produced by Actipro Co...
阅读全文
posted @
2008-05-09 16:22
CoderZh 阅读(1245) |
评论 (7)
编辑
Python天天美味(15) - Python正则表达式操作指南(re使用)(转)
摘要: 找到一篇专门讲Python中的正则表达式的文章,写的非常全面,转过来学习。
阅读全文
posted @
2008-05-06 19:54
CoderZh 阅读(5024) |
评论 (8)
编辑
Python天天美味(14) - splitlines
摘要: Python中的splitlines用来分割行。当传入的参数为True时,表示保留换行符 \n。通过下面的例子就很明白了:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->mulLine="""Hello!!!WellcometoPython'sworl...
阅读全文
posted @
2008-05-05 20:05
CoderZh 阅读(798) |
评论 (0)
编辑
Linux服务器性能数据收集 - Sysstat介绍
posted @
2008-05-05 12:38
CoderZh 阅读(665) |
评论 (1)
编辑
招募Asp.net开发人员一名[上海]
posted @
2008-05-04 16:37
CoderZh 阅读(349) |
评论 (7)
编辑
Python天天美味(13) - struct.unpack
摘要: Python中按一定的格式取出某字符串中的子字符串,使用struck.unpack是非常高效的。1. 设置fomat格式,如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#取前5个字符,跳过4个字符,再取3个字符format='5s4x3s'2....
阅读全文
posted @
2008-05-04 11:29
CoderZh 阅读(2503) |
评论 (12)
编辑
Python天天美味(12) - 条件判断的缩写
摘要: 开始以为Python中没有像其他语言一样的条件判断的缩写形式:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->return(1==1)?"is easy":"my god"//C#中的用法其实,在Python中,是这样写的:Code highlight...
阅读全文
posted @
2008-05-04 11:08
CoderZh 阅读(1138) |
评论 (8)
编辑
Python天天美味(11) - 可爱的大小写
摘要: 转换大小写和其他语言一样,Python为string对象提供了转换大小写的方法:upper() 和 lower()。还不止这些,Python还为我们提供了首字母大写,其余小写的capitalize()方法,以及所有单词首字母大写,其余小写的title()方法。函数较简单,看下面的例子:Code highlighting produced by Actipro CodeHighlighter (fr...
阅读全文
posted @
2008-05-04 10:32
CoderZh 阅读(2792) |
评论 (16)
编辑
Python天天美味(10) - 除法小技巧
摘要: Python中将两个整数相除,默认结果是为整数的。但我们可以通过下面的方法,使得两个整数相除的结果为小数。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->from__future__importdivisionprint7/3输出结果:2.333333...
阅读全文
posted @
2008-05-04 09:55
CoderZh 阅读(940) |
评论 (8)
编辑
Python天天美味(9) - translator
摘要: Python的translate方法真是太有意思了
阅读全文
posted @
2008-05-03 22:10
CoderZh 阅读(2473) |
评论 (10)
编辑
Python天天美味(8) - 字符串中的字符倒转
摘要: 方法一,使用[::-1]:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->s='python'prints[::-1]方法二,使用reverse()方法:Code highlighting produced by Actipro CodeHighlig...
阅读全文
posted @
2008-05-03 20:43
CoderZh 阅读(744) |
评论 (1)
编辑
Python天天美味(7) - 连接字符串(join %)
摘要: join 方法用于连接字符串数组Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->s=['a','b','c','d']print''.join(s)print'-'.join(s)输出结果:abcda-b-c-d使用 % 连接多个变量Code high...
阅读全文
posted @
2008-05-03 20:27
CoderZh 阅读(1409) |
评论 (3)
编辑
Python天天美味(6) - strip lstrip rstrip
摘要: Python中的strip用于去除字符串的首位字符,同理,lstrip用于去除左边的字符,rstrip用于去除右边的字符。这三个函数都可传入一个参数,指定要去除的首尾字符。注意的是,传入的是一个字符数组,编译器去除两端所有相应的字符,直到没有匹配的字符,比如:Code highlighting produced by Actipro CodeHighlighter (freeware)http:/...
阅读全文
posted @
2008-05-02 19:11
CoderZh 阅读(1324) |
评论 (8)
编辑
Python天天美味(5) - ljust rjust center
摘要: Python中打印字符串时可以调用ljust(左对齐),rjust(右对齐),center(中间对齐)来输出整齐美观的字符串,使用起来非常简单,包括使用第二个参数填充(默认为空格)。看下面的例子就会明白了:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--...
阅读全文
posted @
2008-05-02 18:36
CoderZh 阅读(964) |
评论 (4)
编辑
Python天天美味(4) - isinstance判断对象类型
摘要: Python中判度对象类型方法非常简单,不需要像别的语言一样使用如下的判断方法:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->if(typeof(objA)==typeof(String)){//TODO}在Python中只需要使用内置的函数isin...
阅读全文
posted @
2008-05-02 16:47
CoderZh 阅读(1464) |
评论 (1)
编辑
Python天天美味(3) - 字符转换
摘要: Python提供了ord和chr两个内置的函数,用于字符与ASCII码之间的转换。如:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->>>>printord('a')97>>>printchr(97)a下面我们可以开...
阅读全文
posted @
2008-05-02 16:24
CoderZh 阅读(1327) |
评论 (3)
编辑
公告
Happy Coding!! Happy Life!!!
我的邮箱:coderzh#gmail.com
盛大EverBox在线存储邀请
Dropbox邀请
跟随我的推特
我的新浪微博
订阅我的博客
FeedBurner
我的豆瓣
我的GAE博客
我的NancyWiki
昵称:
CoderZh
园龄:
5年6个月
粉丝:
160
关注:
10
搜索
随笔分类
Agile(2)
(rss)
Android(3)
(rss)
ASP.NET(3)
(rss)
C#(20)
(rss)
C/C++(23)
(rss)
Emacs(2)
(rss)
Google App Engine(7)
(rss)
JAVA(4)
(rss)
Linux(1)
(rss)
Lua(2)
(rss)
Python(67)
(rss)
Ubuntu(9)
(rss)
VBS(4)
(rss)
安全性测试(10)
(rss)
测试生活感悟(7)
(rss)
程序人生(14)
(rss)
代码安全(3)
(rss)
单元测试(18)
(rss)
公告(12)
(rss)
每周总结(5)
(rss)
软件测试(30)
(rss)
设计模式
(rss)
性能测试(9)
(rss)
学习笔记(23)
(rss)
随笔档案
2011年5月 (1)
2011年3月 (1)
2011年1月 (1)
2010年12月 (3)
2010年11月 (3)
2010年10月 (2)
2010年9月 (6)
2010年8月 (2)
2010年7月 (4)
2010年6月 (3)
2010年5月 (4)
2010年4月 (9)
2010年3月 (6)
2010年2月 (3)
2010年1月 (16)
2009年12月 (6)
2009年11月 (3)
2009年10月 (4)
2009年9月 (3)
2009年8月 (2)
2009年7月 (7)
2009年6月 (2)
2009年4月 (12)
2009年3月 (5)
2009年2月 (2)
2009年1月 (3)
2008年12月 (7)
2008年11月 (9)
2008年9月 (8)
2008年8月 (7)
2008年7月 (8)
2008年6月 (9)
2008年5月 (33)
2008年4月 (6)
2008年2月 (1)
2007年12月 (3)
2007年11月 (3)
2007年10月 (7)
2007年9月 (1)
系列文章
Python天天美味系列
攻击方式学习系列
瘦客户端那些事
玩转gtest系列
读书笔记
Python网络编程
xUnit Test Patterns
卓有成效的程序员
友情链接
我的GAE生活博客
(rss)
积分与排名
积分 - 509986
排名 - 117
最新评论
阅读排行榜
评论排行榜
推荐排行榜