Skip to content

Commit 97edd39

Browse files
committed
增加 web.py
1 parent 0db60bf commit 97edd39

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

libs/python.wiki

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,33 @@ Wikipedia:[https://en.wikipedia.org/wiki/TurboGears 英文]、[https://zh.wiki
364364

365365
又一个重型的 Web 开发框架,名气仅次于 Django。
366366

367+
<h4>web.py</h4>
368+
369+
Home:[http://webpy.org/]
370+
371+
与前两个(Django、TurboGears)不同,这是一个轻量级的框架。甚至被称为“It's the anti-framework framework.”
372+
373+
其作者是大名鼎鼎的黑客 [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron Swartz]。(俺在[http://program-think.blogspot.nl/2013/01/weekly-share-37.html 某篇博文]中悼念过他)。
374+
375+
当年 Aaron Swartz 用 web.py 来搭建同样大名鼎鼎的网站 [https://en.wikipedia.org/wiki/Reddit reddit](该网站是 Web 2.0 的标杆)。
376+
377+
代码示例——Hello world
378+
<source lang="python">
379+
import web
380+
381+
urls = (
382+
"/", "index"
383+
)
384+
385+
class index:
386+
def GET(self):
387+
return "Hello, world!"
388+
389+
if &#95;&#95;name&#95;&#95; == "&#95;&#95;main&#95;&#95;" :
390+
app = web.application(urls, globals())
391+
app.run()
392+
</source>
393+
367394
== 4.4 Web前端 & JS整合 ==
368395

369396
<h4>Pyjamas & pyjs</h4>

0 commit comments

Comments
 (0)