First I have the basics of programming language, you have the best, so you will soon know Python.Of course, because of my knowledge and learning limitations, please the vast number of ape/yuan to forgive and correct, common progress.First of all,
1, in the Linux environment has installed the FreeSWITCH, (not installed FreeSWITCH, please install the documentation)2, enter the source code directory CD LIBS/ESL directory first install yum install Python-develL Install Python-devel First,
1. Multiple if statements, whether to execute the problem sequentially:What about the left?Condition 1 met, and after he had finished his blabla, he would continue to judge condition 2.On the right?If the condition 1 is met, he will not execute the
PYTHON specifies special variables with underscores as variable prefixes and suffixes._xxx cannot be imported with ' from Moduleimport * '__xxx__ System Definition NamePrivate variable names in the __xxx classCore style: Avoid using underscores as
Input is a built-in function:
>>> input>>>
?Specific usage: Receives the user input the content, the input string, receives is the string, the input is the number, receives is the number
Stupid way to learn the 39th verse of PythonThis section is mainly about dictionaries, the first two differences between a dictionary and a list are:1. The list can be found by numbers in the list of elements, the number as the index, the dictionary
Variable: The program will use a lot of temporary storage data when running, this time use the variable, the name of the temporary data.Variables in Python do not need to be declared and can be used directly, and the data type of the variable is
1. Pilot inbound: From datetime import datetime2. Get the current date and time: Now_time = DateTime.Now ()3. Format the date we want: Strftime ()For example: "2016-09-21": DateTime.Now (). Strftime ('%y-%m-%d ')4. Add 1 hours to the current time:
Python can be used to encrypt files via Hashlib. Hashlib can support a variety of encryption, the most common MD5 for example, we can use to encrypt the user's input password, and then saved in the database.Example 1 encrypted stringImport
One, match meta-charactersThe use of meta-characters can be easily manipulated to write regular expressions more convenientCommon Meta characters:. It matches any character except the newline character in alternate mode (re. Dotall) It can even
1.#class #A class is a template that can contain multiple functions and functions in a template . #define a class classBar:deffoo (SELF,AGR):Print(SELF,AGR) obj=Bar ()Print(obj)Print(Obj.foo ("methods to invoke a class"))2.#Method
Python MultithreadingMultithreading is similar to executing several different programs at the same time, multithreaded operation has the following advantages:
Threads can be used to place tasks that occupy a long period of time in the
Python crawler simulated login knowledge, python crawler Simulation
I have previously written a blog about crawling movie heaven resources using python crawlers, focusing on how to parse pages and improve crawler efficiency. Because all users have
PythonCrawl self-learning log (3) and pythoncrawl self-learning log
September 21, 2016 09:21:431. Crawling cycle:(1) first generate an initial request to crawl the first url, and specify a callback function called the response to the download
Python crawls The Three Kingdoms
The crawler tutorial in this article is divided into four parts:
1. where to crawl where
2. what to crawl
3. how to crawl
4. How to save the information after crawling
1. Where to crawl
Romance of Three Kingdoms
Ii.
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