2010年11月27日 星期六

python

kakashi@kakashi-laptop:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Related Posts:

  • python UnicodeEncodeError最近在玩qPlurk遇到的一個問題 UnicodeEncodeError: 'ascii' codec can't encode characters in position 42-44: ordinal not in range(128) 好像是因為再拿html的時候出的問題 解決的辦法就是利用 import sys reload(sys) sys.setdefaultencoding("utf-8") reference: 從這個站看… Read More
  • pythonkakashi@kakashi-laptop:~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. import this The Zen of Python, by Tim Peters Be… Read More
  • FreeBSD + Apache2 + Mod_wsgi + Django最近在搞django , 之前試過在lighttpd上面用fastcgi跑django,不過光安裝就讓我一個頭兩個大,這次在不考慮效能的情況下想試試看用apache2 + mod_wsgi + django的安裝模式, 看是否有比較快, 安裝過程參考http://www.indexofire.com/blog/?p=243 幾乎是一模一樣啦,不過最後的地方我有特別標示清楚 1. FreeBSD是7.2,先更新完ports 2. Ports安装… Read More
  • Flask Note 1想要來寫個Flask筆記, 這個系列會把一些看到, 或是曾經使用過的技術給記錄下來 環境需求:python2.7以上, python套件pip & virtualenv安裝 0. 建立virtualenv環境, 使用virturlenv目的就是為了建立一個乾淨的開發環境, 可以去掌握你撰寫的python程式跟其他package的相依性, 利於你的程式部署到其他機器上 $ pip install virtualenv Requ… Read More
  • python object and static method 這是一則早該紀錄的文章,只能說我太懶惰了-.-,一切都是從這裡開始的,有天心血來潮想來review一下design pattern,結果跑去看良葛格的文章simple factory ,可是問題跑出來了,他下面的python code我不能跑,會出現錯誤跑出 TypeError: unbound method getMessage() must be called with MessageFactory instance as f… Read More

0 意見:

張貼留言