24. Dễ học Cấu trúc, cú pháp đơn giảnThư viện nhiều, chất lượng tốt json, http, xml, zlib imap, pop3, snmp, sqlite, mysql twisted, django, cherrypy ... Đa năng Server: Web app, chat server, mail server, monitor service, các app tích hợp dịch vụ, Client: Phần mềm GUI, nghiên cứu dữ liệu... Code một tí là chạy được...
25. Free Đa hệ Hiệu năng cao (high-perf) Network, memory, serialize/deserialize Hiệu quả cao productivity, maintain, deploy
27. Web site: Google, Google App Engine, Youtube, Google Web search.... System: NASA, IBM, HP, Intel, Cisco... Desktop: Dropbox, Miro player Mobile phone: Nokia, Microsoft (Windows CE) P2P: Bittorrent
31. x = 34 - 23 # A comment. y = “Hello”# Another one. z = 3.45 if z == 3.45 or y == “Hello”: x = x + 1 y = y + “ World”# String concat. print x print y
32. Whitespace Multiple assignment Document string Sequence types, list comprehension Functions: define, default value, order of args, used as data type Json, Send mail, Twisted, Cherrypy
33. Whitespace Whitespace is meaningful in Python: especially indentation and placement of newlines. Use a newline to end a line of code. Use when must go to next line prematurely. No braces { } to mark blocks of code in Python… Use consistent indentation instead. The first line with less indentation is outside of the block. The first line with more indentation starts a nested block Often a colon appears at the start of a new block. (E.g. for function and class definitions.)
34. Comment & document Start comments with # – the rest of line is ignored. Can include a “documentation string” as the first line of any new function or class that you define. The development environment, debugger, and other tools use it: it’s good style to include one. defmy_function(x, y): “““This is the docstring. This function does blah blah blah.”””# The code would go here...
42. Easy install Example 1. Install a package by name, searching PyPI for the latest version, and automatically downloading, building, and installing it: easy_install SQLObject Example 2. Install or upgrade a package by name and version by finding links on a given "download page": easy_install -f http://pythonpaste.org/package_index.html SQLObject Example 3. Download a source distribution from a specified URL, automatically building and installing it: easy_install http://example.com/path/to/MyPackage-1.2.3.tgz