cherrypy應用探究

CL.TANG發表於2016-10-18

1. cherrypy是什麼?

  cheerypy是一個有pythonic特性的物件導向的http服務框架。

  玩python的人都應該知道pythonic這個單詞。python大神給我們的建議 :  

>>> 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!

  也就是說cherrypy的開發人他覺得自己做到了,或者做到了一些,話是否大了,接著研究,看他憑什麼這麼說。

2. 一門語言的http框架功能點。

  1. http服務。像apache的web sevice, python自帶的simpleserver,都是在做監聽埠服務,監聽完成後完成資料轉換,是否滿足應用要求,然後根據應用邏輯作出相應,在有服務傳遞資料回客戶端。cherrypy必須完成這樣的功能。

 

相關文章