I 've been busy with other jobs recently. I only found that I haven't posted a blog post for a month. I 've been here for the first time in the past two months.
-------------------------------------------
Requirement: Recently, I have to refer
The face detection function of opencv is good in general. Ubuntu provides the python-opencv package, which can be used to conveniently implement face detection.Code.
Install Python-opencv before writing code:
$ Sudo apt-Get install Python-opencv
Python Study Notes-first knowledge of Python
1. Install python3
The latest Python version 3.3.2 is available on the official website!
Check whether python is installed on your computer. Python 2 is pre-installed on Linux and Mac OS, but not
Python's functools module provides three interesting functions: partial, update_wrapper, and wraps.
Partial function, which can re-bind the optional parameters of the function to generate a callable partial object.
The update_wrapper function copies
Python's functools module provides three interesting functions: partial, update_wrapper, and wraps.
Partial function, which can re-bind the optional parameters of the function to generate a callable partial object.
The update_wrapper function copies
In general, Python's GC garbage collection mechanism has a set of algorithms that can be used to recycle referenced objects and avoid Memory leakage.
However, there is an exception: the _ del _ method is overwritten.
Example:
#-*-Coding: UTF-8-*-#
Python: whetting your appetiteIf you do much work on computers, eventually you find that there's some task you 'd like to automate. for example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange
Urllib reads the webpage and then writes the Excel file in Py-Excel.
Import urllibfrom xlwt import workbookimport datetimedef fetchdata (): Book = Workbook (encoding = 'gbk') # If the collected data has Chinese characters, add this sheet1 = book.
The maximum number of matching regular expressions, 65535? Re. debug can query the maximum number of matches. In fact, it returns the debug information for each RegEx.
When compile is used to compile expressions, the latest several are cached.
The code is very simple, with less than 5 k lines. However, the idea is quite good. After we change to non-blocking, the efficiency can be improved a lot. Especially considering that modern web apps need to communicate with other HTTP servers,
1. Install stackless python2.5
Address: http://www.stackless.com/binaries/python-2.5.2-stackless.msi
Note: If you need to install it on the Vista system, you must use version 2.6. Otherwise, NTDLL. dll will run incorrectly.
2. Download The stackless
Python is a very good scripting language. It is flexible and lightweight to use and can communicate with local languages such as C/C ++.
The following describes how to install and use python in windows. I personally prefer to use version 3.x
Document directory
Pybloom 1.0.2
Http://bitworking.org/news/380/bloom-filter-resources
The bloom filter, conceivedBurton H. BloomIn 1970, is a space-efficient probabilistic data structure that is used to testWhether an element is a member of
Search for help
Dir (string) # You can view all the member variables and functions of the module.
# The following code separates variables and functions into a list.For FV in Dir (string ):Name = "string. % s" % FvIf callable (eval (name )):Funorc.
This function is said to be called a function generator. I did not see it in the Document. Later I read a usage on the Internet and found that it is actually equivalent to the Return Statement. The following code:
def addlist(alist):
for
This is really not easy to understand, first go to the Code, this code is a usage of the function decorator. Let's look back.
#!/usr/bin/env python
from time import ctime, sleep
def tsfunc(func):
def wrappedFunc():
Execute multiple Test suites (suites)
Chaining together a suite of tests
Unittest makes it easy to chain together test cases into a testsuite. A testsuite can be runJust like a testcase, but it also provides additional functionality to add a single
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