python--a few articles that must be read in Python

Source: Internet
Author: User

Python is easy to get started as a scripting language, but it's not a day's work to learn python well enough to write a beautiful, Pythonic python code, the purpose of this article is to recommend some excellent Python-related articles (for books you can see dip, learning Python and the Official Handbook go), making it a little detour to grow into a Python master. Note: The articles are in English, it is necessary to learn python to read English materials.

1. PEP8 Style Guide for Python Code

Row first is the Python code specification PEP8, this will not need me to say, whether it is a beginner or a master PEP8 are must know in the chest. In following the rules described in the same time, we also have to remember two more special words, but these two words must not abuse:)

    The good reasons to break a particular rule:    (1) When applying the rule would make the code less readable, even for
   someone who's used to reading code that follows the rules.    (2) to being consistent with surrounding code, also breaks it (maybe for        historic reasons)--although the is also a N opportunity to clean up        someone else's mess (in true XP style).

If you want to write Python's C extension library, you must also learn the PEP7.

2. Code like a pythonista:idiomatic Python

As the name of the article, the length of the text, but very very practical. This article describes a series of Python conventions used and techniques that will allow you to write the Python code immediately on a level that allows you to become a real pythoneer.

3. PEP318 decorators for Functions and Methods

Decorator is very common in Python's world, and the common example of auth, the cache, provides Decorator,decorator functions and methods that are defined immediately after the decorator. You can give an existing function and method to your own needs.

4. Python Regular Expression documentation

Mastering regular expressions is an essential skill for programmers, which is the official document of the RE module, which is often used to turn over when using regular expressions. Python's regular expression is a bit different from other language functions, so there are people complaining that Python's re module is not working, and that the regular expression rules section of the article starts with the regular expression, if you don't know what the regular expression is. Personally think that Python's re module is very powerful, give a bit of an example, such as Verbose's regular expression also support in the middle of regular expressions to annotate the specific meaning of regular expressions, because regular expressions are often as difficult to understand as the heavenly book, so this function is very useful.

A = Re.compile (r "" "\d +  # the integral part                   \.    # The decimal point                   \d *  # some fractional digits "", Re. X

5. PEP333 Python Web Server Gateway Interface v1.0

If you're going to use Python for web-related development (mostly for people, it means web use) WSGI is a must-read, WSGI is the official standard between Python Web server, application, and middleware, Now the mainstream Python Web server and the framework are sure to support WSGI. Only by knowing Wsgi can you better understand how Python's web framework works, why middleware is connected, and how Web server interacts with Web application. Wsgi There are two people who are criticized, one is not support async, Tornado is an asynchronous Web server, but to run Wsgi's framework like Django on it, the Tornado Async feature is completely unused; v1.0 does not support python3.x, in order to support python3.x, there are two pep documents PEP3333 and PEP444 that are also in the draft State for reference.

6. How to use the Linux epoll with Python

In more depth, if you want to do server-side programming, this article will give you a deep understanding of Python synchronous, asynchronous socket programming mode. If you think the source of tornado is difficult to understand, reading this article will be of great help to you.

7. There are some more important documents, here do not explain, interested students can go to see:

    • Python Tips, Tricks, and Hacks
    • Python docstring
    • Coroutines via enhanced Generators
    • Greenlet Documentation
    • Unifying types and classes in Python (to FQ)
    • Python Attributes and Methods
    • Python Types and Objects, Chinese version see: http://wiki.woodpecker.org.cn/moin/PyTypesAndObjects
    • Python Best Practices
    • PEP (the Zen of Python) by example
    • Google Python Guide
    • To be added: welcome everyone to recommend.

Reprint Please specify source: Http://feilong.me/2011/01/recommended-entries-for-you-to-master-python

python--a few articles that must be read in Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.