Teacher Liao Website: http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000
Take a few days to see teacher Liao's python tutorial, now Summarize.
(i work with Python 1.5, there is a certain Python foundation, read the "python core programming" and part of the "python source code analysis", only to feel useful to remember)
- Advanced Features
- slices, for list and tuple
- Generator yield, used by the co-process, for asynchronous
- Iterator iterable (can be used for), where the generator is an
Iterator
object (which can be used for next), but,, list
dict
str
Although Yes Iterable
, it is notIterator
- Function-type programming
- Higher-order functions, One function can receive another function as a parameter, and this function is called the higher order function (map, reduce, filter, sorted ...). )
- adorner, dynamically adding functionality during code run, using ' @ Function name '
- Partial function, can be created with functools.partial
- Object-oriented Advanced Programming
- __slots__, restricting the properties that a class instance can add, and also reducing the memory that the class instance occupies
- @property, The Magic Decorator method
- Metaclass Meta class, Customizable class, If you do not know the proof is not used, type () can create a class
- Commissioning and testing
- debug, lowest level print, second assertion (assert), preferably with logging, pdb (pdb.set_trace ()) or similar method
- testing, Unit Testing (unittest) and document testing (doctest)
- processes and threads
- multi-process, Less use of os.fork () linux, multiprocessing,process Create process, pool creates process pools, subprocess creates child processes,
Queue
, pipes interprocess communication
- multi-threaded, threading, lock; python interpreter due to the Gil Global lock at Design time, multithreading cannot take advantage of multi-core
-
ThreadLocal,
resolves an issue in which parameters pass between functions in a thread
- distributed processes, multiprocessing
.managers. basemanager
- Web Development
- HTML is a text that defines a web page, which is used to write Web pages, and HTTP is a protocol for transmitting HTML over a network for browser and server communication
- HTML defines the content of the page, CSS to control the style of the page elements, and JavaScript is responsible for the Page's interactive logic
- Wsgi:web Server Gateway Interface, interface to receive HTTP requests, resolve HTTP requests, Send HTTP Responses
- Web framework, Let's move from WSGI processing function to url+ corresponding processing function, the WSGI abstraction out; Python's Common web Framework is django, tornado, flask
- Use template MVC to improve programming efficiency
- Asynchronous IO
- coroutine, High efficiency, No lock mechanism required, python using generator yield implementation
asyncio,
Provides complete asynchronous IO support ( async
and await,
new syntax for coroutine)
aiohttp,
asyncio
implementation-based HTTP Framework
Liaoche Teacher Python Tutorial after reading notes