When I looked at the PHP framework a few days ago, I found a powerful hook that can be hung on the hook points of the system and automatically run the hook function by the system. After learning how to use PHP hooks, I immediately Google python to
the original author is swaroop c h.Original websiteHttp://www.swaroopch.com/notes/PythonThis version is translated as I _nbfa, which is only used for learning and communication.========================================================== ==============
I unsubscribed TO THE python.cn email list today.
In the python.cn mail list for a year, it has grown a lot and then exited. There is no reason. I have a whimsy, so I will come back to practice it. After a while, if you have another whimsy, you
Appearance mode:Application features:When many complex and small functions need to be called, and these calls are often related, that is, one call is a series.Structural Features:
The original complex and numerous calls are planned to be unified
Zhou haihan/Wen
2010.4.27
Sometimes you can see a mail file. The mine part of the content adopts base64 encoding, but there is no tool to decode it. In this case, you can use the python base64 module.
In the last email, nothing was
Effect of list "="
In python, another list needs to be copied, but "=" cannot achieve the replication effect.
For example:
L1 = ['hello', 'World'] L2 = L1
At this time, we only added a "Pointer" L2. In other words, we added two tags to
Decoration mode:
Application features: it dynamically adds decorative features to the main function.
Structural Features: Separate decorative functions from main functions, and then select decorative functions to modify the main functions as
Factory model:
Application features: in fact, the factory mode is the object creation mode. If you want to create an object for you. Generally, a request is received and a requested object is returned.
Structural Features: An Independent
It can be determined by Class Members of the types module. In fact, all types in Python are instances of the type in the types module.
Import typesType (X) is types. inttype # judge whether the int type is usedType (X) is types. stringtype #
In python, The telnetlib module that supports Telnet is a built-in module and can be directly imported. Its basic usage is relatively simple.
# Encoding = utf-8def do_telnet (host, username, password, finish, commands): Import telnetlib '''
Online persistence implemented by PythonEven on the campus network, if no traffic is downloaded for a period of time, the network is automatically disconnected. Therefore, write this program to regularly access the network and download irrelevant
Proxy Mode
Application features: You need to add an intermediate control layer when special intermediate operations are required between the communication parties.
Structural Features: create an intermediate class, create an object, receive an
Factory method
Application features: When the objects to be generated often need to be added or modified, the variable content is extracted and placed independently in a class.
Structural characteristics: a factory class is separated into multiple
Prototype:
Application features: it is used when a large number of modifications are required based on a basic prototype to obtain a new prototype.
Structure Features: Object replication mechanism [light replication and deep
Builder mode:
Application features: create identical modules in the same category to avoid missing inherent attributes
Structural Features: standardizes the Created processes, customizes the specific tasks of each process, and quantifies the
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