21. Agile Manifesto
• Individuals and interactions over
processes and tools
• Working software over
comprehensive documentation
• Customer collaboration over
contract negotiation
• Responding to change over
following a plan
54. Crockford
HTML5
HTML
• Semantics (New tags, Link Relations, Microdata)
• Web Forms 2.0 (Input Fields)
• Multimedia (Audio Tag,Video Tag)
• 2D and 3D drawing (Canvas, WebGL, SVG)
70. web
• Other frameworks: Quixote, django,leazy ...
• http://bitworking.org/news/
Why_so_many_Python_web_frameworks
71. web
• Other frameworks: Quixote, django,leazy ...
• http://bitworking.org/news/
Why_so_many_Python_web_frameworks
the answer is often that it is way too easy to put together
one in Python. That certainly seems plausible since there
are so many libraries that implement the components of a
web framework and if it's easy to plug those pieces
together then maybe that lowers the bar of entry for new
frameworks.
72. web
• Other frameworks: Quixote, django,leazy ...
• http://bitworking.org/news/
Why_so_many_Python_web_frameworks
Templating : kid
73. web
• Other frameworks: Quixote, django,leazy ...
• http://bitworking.org/news/
Why_so_many_Python_web_frameworks
Templating : kid
SQL : SQLAlchemy
74. web
• Other frameworks: Quixote, django,leazy ...
• http://bitworking.org/news/
Why_so_many_Python_web_frameworks
Templating : kid
SQL : SQLAlchemy
Routing : Selector
85. doctest - unittest
>>> python utest_driver.py
..
---------------------------------------------
Ran 2 tests in 0.043s
OK
86. nose easy_install nose
extends unittest to make testing easier. http://somethingaboutorange.com/mrl/projects/nose/
87. nose easy_install nose
extends unittest to make testing easier. http://somethingaboutorange.com/mrl/projects/nose/
utest1.py utest2.py nosetests
bash-3.2$ nosetests --with-doctest
..
------------------------------------
Ran 2 tests in 0.038s
OK
bash-3.2$
88. nose easy_install nose
extends unittest to make testing easier. http://somethingaboutorange.com/mrl/projects/nose/
Write your nose test file:
nose_test_case.py
89. nose easy_install nose
extends unittest to make testing easier. http://somethingaboutorange.com/mrl/projects/nose/
Write your nose test file:
base$ nosetests nose_test_case.py
.
----------------------------------------
Ran 1 test in 0.001s
OK
nose_test_case.py base$
90. nose easy_install nose
extends unittest to make testing easier. http://somethingaboutorange.com/mrl/projects/nose/
Write your nose test file:
base$ nosetests nose_test_case.py
.
----------------------------------------
Ran 1 test in 0.001s
OK
nose_test_case.py base$
Any function or class that matches the configured testMatch regular expression
((?:^|[b_.-])[Tt]est)
92. ipython
iPython http://ipython.scipy.org/doc/stable/html/
bash$ ipython
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: ls
Flask-0.3.1/
memcached-1.4.5/
objc-json/
web.py-0.34/
einstall.py*
numpy/
scipy/
In [2]: print "hello world"
hello world
93. virtualenv
virtualenv python
$ virtualenv --no-site-packages vetest
$ cd vetest
$ source bin/activate
(vetest)fbmac:vetest fengbo$ ls
bin include lib
(vetest)fbmac:vetest fengbo$ python
>>> import BeautifulSoup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named BeautifulSoup
>>> exit()
$ sudo easy_install BeautifulSoup
$ python
>>> import BeautifulSoup
>>>
94. C (1)
Cython easy_install cython
python
def say_hello(name): Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14)
print "hello, %s" % name [GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
cython_test.pyx
>>> import pyximport
>>> pyximport.install()
>>> import cython_test
>>> cython_test.say_hello("world")
hello, world
>>> exit()
95. C (2)
Cython easy_install cython
setup.py
def say_hello(name): from distutils.core import setup
print "hello, %s" % name from distutils.extension import Extension
from Cython.Distutils import build_ext
cython_test.pyx ext_modules = [Extension("hello", ["cython_test.pyx"])]
setup(
name = 'Hello world app',
cmdclass = {'build_ext': build_ext},
compile to .so file ext_modules = ext_modules
)
96. C (3)
Cython easy_install cython
$ python setup.py build_ext --inplace
$ ls
build cython_test.c cython_test.pyx hello.so setup.py
$ python
>>> import hello
>>> hello.say_hello(“world”)
>>> hello, world