Recently to go back to school to do the completion of the set, ready to do a related algorithm, I heard that Python operations better, specifically to learn.
Let's start with the basics .......... ...........
SliceTaking a partial element
Python second, crawl Baidu Post, get the title of the post, content, the floor, release timeThere is a problem, when the post is posted on the mobile phone, at this point in the page will be identified, so a more span tag, as the floor and publish
One, if statementPerform different actions according to different conditions.Syntax: There are 4 main cases1. Single-branch, single-condition judgmentif Condition: The code snippet is executed only if the condition is true. )2. Single branch,
First knowledge of PythonFirst, Python introduction.Python is a programming language, and its founder, Guido van Rossum (Guido van Rossum), aims to create a language between C and the shell, functionally comprehensive, easy to learn, easy to use,
ConceptProcess : A process is a dynamic execution process of a program on a data setProgram: CodeDatasets: Resources needed during program executionProcess Control BLOCK: a unit that completes a State saveThreads: threads are pinned on the process,
Arithmetic operatorsTake surplus(% b); #1Take the Divide+// b); #2logical operatorsPrint (01); #0print (01); #11); 0); #TrueLogical operators can also be used to compare sizes;p rint (large andsmall); #print (large or
Python is stronger than web development, network programming, scientific computing, etc.Python constants are denoted in uppercase to distinguish between lowercase variables, and constants should not be modified;Python has a high level of formatting
There are two functions under the OS module:Os.walk ()Os.listdir ()1 #-*-coding:utf-8-*-2 3 ImportOS4 5 deffile_name (file_dir):6 forRoot, dirs, filesinchOs.walk (file_dir):7 Print(Root)#Current directory
3 Local Variables3.1 Definition:A variable that takes effect only in the function, which is the scope of the variable, leaving the function, there is noeg def function (name):Print (name)function ("Logan")Print (name) #这个地方会报错 because we do not
1 Basic data typesWhat is data?x=10,10 is the data we want to store.2. Why the data is divided into different typesData is used to represent States, and different States should be represented by different types of data.3. Data typeNumbers (shaping,
Python multithreadingmultithreading -threading pythonthread module is the lower module, python threading module is Did the packing, can be more? 1. module single thread?1 Import Time2 defSaysorry ():3 Print("Honey, I was wrong,
Os.listdir (dirname): Lists directories and files under DirName os.getcwd (): Get current working directory Os.curdir: Returns the current directory ('. ') Os.chdir (dirname): Change the working directory to Dirnameos.path.isdir (name): Determine if
The person who picks the projectSource: http://blog.csdn.net/Dream_angel_Z/article/details/50760130GitHub Source code: Https://github.com/csuldw/MachineLearning/tree/master/PCAPCA (principle component analysis). Principal component analysis is
#Coding=utf-8#Author:ruin"""discrible:""" fromThrift.transportImportTsocket fromThrift.protocolImportTbinaryprotocol fromThrift.transportImportTtransport fromHBaseImportHbaseImportstruct#Method for encoding ints with Thrift ' s string
First, Python introductionThe founder of Python is Guido van Rossum (Guido van Rossum). During the Christmas of 1989, Guido van Rossum to spend time in Amsterdam, determined to develop a new script interpreter, as an inheritance of the ABC
About Redis
Redis is based on memory, or can be based on disk persistence NoSQL database, using C language development.
Data storage structure: Key-value
Installation Environment Preparation
Redis is developed using the C language and needs to be
1. The Python standard Database interface provides the developer with a database application programming interface for Python Db-api,python Db-api.
The Python database interface supports a very great number of databases, and you can choose the
Set () Set
How to create a collection:
1 #集合是无序的不重复的2 li = [11,22,11,33]3 a = Set (LI) 4 print (a) 5 {33,22,11}
A = {11,22,33,44= {22,5577= {11,22,33,44= {22,55c = (a) #discard移除集合不存在的元素不会报错, remove removes an error A.discard (99)
#intersection ()
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