PythonNote

=Python Learning Note=

Installation

 * Official Site www.python.org
 * Alternative download click

=Language Primer= http://www.python.org/dev/peps/pep-0008/
 * Style Guide for Python Code


 * Free learning materials
 * Dive Into Python 2.x
 * Dive Into Python 3.x
 * Learn Python The Hard Way, 3rd Edition

if statement

 * if
 * if else
 * if elif else

loop statement

 * for i in range(...
 * for else (else clause is executed when for exhausts its option, see more)
 * while boolean

Methods

 * __repr__ Evaluatable string representation
 * __str__ Printable string representation
 * __cmp__ Object comparison, cmp(obj, x)
 * __del__ Destructor
 * __init__ Constructor
 * __add__ overloading '+'

Reference
 * issubclass
 * isinstance
 * http://www.tutorialspoint.com/python/python_classes_objects.htm

Lambda
Reference python=lambda-why

Lock and Queue
Reference http://www.tutorialspoint.com/python/python_multithreading.htm

=Object Oriented Programming=

Goals

 * Robustness
 * Adaptability
 * Reusability

Principles
Reference Programming]]
 * Modularity
 * Abstraction
 * Encapsulation
 * [[LearningLite#Object_Oriented_Programming| Learning Note: Object Oriented
 * The End Of Object Inheritance & The Beginning Of A New Modularity, Google 2013

Design

 * CRC Class-Responsibility-Collaborator
 * Responsibilities
 * Independence
 * Behaviors


 * p83

Namespace
=Algorithm=
 * Constant 1
 * Logarithm logn
 * Linear n
 * n-log-n nlogn
 * Quadratic n^2
 * Cubic n^3
 * Exponential a^n

=Data Structure=

Tree
=Cook Book=

Regular Expression
Reference
 * http://www.pythonregex.com/
 * http://www.tutorialspoint.com/python/python_reg_expressions.htm

File IO
Reference http://www.tutorialspoint.com/python/python_files_io.htm

MySQL

 * Python MySQL Database Access click

SAX

 * read only
 * parse while reading
 * never store the while file

DOM

 * parse the while file into DOM tree
 * editable

lxml

 * lxml api _Element _ElementTree


 * win32 click

openpyxl

 * http://openpyxl.readthedocs.org/en/latest/

REST and SOAP

 * list of rest modules click
 * requests click
 * urllib2 build-in module, only supports GET and POST
 * Missing manual click
 * hack way for PUT method

unittest
Reference click

=Reference= =Links=
 * Tkinter http://www.tutorialspoint.com/python/python_gui_programming.htm
 * http://www.lfd.uci.edu/~gohlke/pythonlibs/