MathCurvesSurfacesWallpaper GroupsGallerySoftwarePOV-Ray
ProgramingLinuxPerl PythonHTMLCSSJavaScriptPHPJavaEmacsUnicode ♥
Web Hosting by 1&1

Python Tech 2012: django, CherryPy, unittest, nose, celery, decorator, YAML

Xah Lee,

I attended some python conference this week. Here's some random notes on python tech i've learned. Most of these are advanced.

What Are Some Most Popular Python Web Frameworks?

Explicitly mentioned by Google App Engine:

Google App Engine supports any framework written in pure Python that speaks WSGI, including Django, CherryPy, Pylons, web.py, and web2py.

Here's the popular python web frameworks:

They are all based on WSGI. WSGI (Web Server Gateway Interface) is python library that's a simple interface between a python web framework and web servers. So that, each python web app framework can all use this, instead of each creating their own.

Automated Testing Tool

unittest is a python lib for automated testing. It's bundled with python 2.7. (http://docs.python.org/library/unittest.html)

python nose is a improved version of python unittest lib for automated-testing. Nose extends the test loading and running features of unittest, making it easier to write, find and run tests.

Advantages of “python nose” over unittest:

above opinion by “abbot” from http://stackoverflow.com/questions/5696884/python-nose-vs-unittest

Python Nose home page: http://nose.readthedocs.org/en/latest/

Celery Task Queue

Celery Task Queue (celeryproject.org) is a asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well. Written in python.

Python Decorators

YAML Data Format (like JSON)

YAML. A data format for similar purpose as XML or JSON. The design emphasize on human-readable. The syntax is similar to python by using indentation for nesting, and otherwise similar to lighweight markups. Data are line-based (like unix config files), and doesn't use any type of matching-pair brackets. Here's a quote from Wikipedia:

A major part of its accessibility comes from eschewing the use of enclosures like quotation marks, brackets, braces, and open/close-tags which can be hard for the human eye to balance in nested hierarchies.

Sample YAML file, used by Google App Engine:

application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: helloworld.app

Another Sample YAML file from Wikipedia:

---
receipt:     Oz-Ware Purchase Invoice
date:        2007-08-06
customer:
    given:   Dorothy
    family:  Gale

items:
    - part_no:   A4786
      descrip:   Water Bucket (Filled)
      price:     1.47
      quantity:  4

    - part_no:   E1628
      descrip:   High Heeled "Ruby" Slippers
      size:      8
      price:     100.27
      quantity:  1

bill-to:  &id001
    street: |
            123 Tornado Alley
            Suite 16
    city:   East Centerville
    state:  KS

ship-to:  *id001

specialDelivery:  >
    Follow the Yellow Brick
    Road to the Emerald City.
    Pay no attention to the
    man behind the curtain.
...
blog comments powered by Disqus