This article describes the rapid use of the logging module, If you need in-depth customization, please refer to (http://docs.python.org/2/howto/logging-cookbook.html)
Import logging. basicconfig (format = '[% (asctime) S]' + logging.
ArticleDirectory
I. What you need to know when using Python
Ii. Install activepython
3. Install python from python.org (http: // www. P ython.org /)
Iv. Summary
I. What you need to know when using Python
There are two options
IfProgramDirectly use the python module exported by this program, you do not need to export it to the PYD library.
For example, if program A has its Python extension module named exta, after calling the initialization function initexta () of the
Python iterator and Generator
I. iteratorsThe iterator is only a container object and implements the iterator protocol. It has two basic methods:1) Next MethodReturns the next element of the container.2) _ ITER _ MethodReturn iterator itself
The
Speaking of global variables and local variables today, the foreign teacher said that global variables are like stars in Hollywood and everyone knows. Local variables must be declared before they can be used. Otherwise, people do not know.
# The
Concise Python tutorial --- 15. More Python content
Special Method
Some methods have special meanings in the class, which has been mentioned earlier. For example, the _ init _ method and the _ del _ method.
These special methods are very useful.
Coding the matrix: Linear Algebra
Through Computer Science Applications
This is a course for implementing matrix operations using python. For the first assignment, I felt that python was greatly improved and various data types were used.The Code is
When we use the open () function to open a file, there are several open modes. 'R'-> Read-Only 'W'-> write-only. If the file already exists, it is cleared. If the file does not exist, it is created. 'A'-> append, write to the end of the file 'B'->
In order to learn English, I converted the movie downloaded from the Internet into a pure MP3 file and put it in itouch, so that I can directly practice my listening. In addition, I also put the downloaded subtitles in, you can check it when you are
'''gen_python_api.py generates a python.api file for SciTEThe generated api file includes *) all Python keywords *) all builtin functions *) all module attributesModule functions are represented by their docstring if available,otherwise by the
Test Environment 1: win7
Test environment 2: ubuntu10.04
Install the Erlang Environment
1. Download: http://erlang.org/download.html
Download the source code package or win Binary Package as needed.
2. installation:
In Windows, there is nothing to
Reprinted from https://gist.github.com/859717133. HTML tags are simply filtered when used <>
import restr = "srcdhello"str = re.sub(r']*>','',str)print str
# Is there a simpler way to use htmlparser? Regular Expression?
Def strip_tags (HTML):
[Reprint] the original address http://blog.sina.com.cn/s/blog_681315fa0100imtk.html
If you use python to write a relatively large program, you will certainly use the log system. Especially for dynamic languages like python, many errors can only be
Friends who have used the hashlib library must have encountered the following errors: "Unicode-objects must be encoded before hashing", which means that before performing MD5 hash, data must be encoded. In addition, python of different versions is
Parse XML strings using Python
13:30:28
Add to favorites I want to contribute
After checking the web for half a day, the built-in XML. Sax is lightweight and simple.
Given that even the simplest examples of code on the Internet
Read and Write excel in Python
10:02:21 let me say a few words
Add to favorites I want to contribute
Read and Write excel in PythonBecause I am tired of manual operations on Excel tables, I took the time to learn how to operate
Python file operation instance Source: EDIT: EXP
Time: 2012-09-14
[Python]#-*-Coding: UTF-8 -*- Import OSImport shutil #1. Path operations: Judgment, acquisition, and deletion #1. Get the current working directory, that is, the directory path for
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