When doing data analysis, to a set of analysis, and analysis of the relationship between multiple sets of analysis, then with the traditional cycle of comparison trouble, the collection provides a lot of methods, it is easy to compare the
Brief introductionSimplehttpserver is a Python 2 comes with a module, is a Python Web server, simple and small, fast start.It has been incorporated into the Http.server module in Python 3.The usage of simplehttpserver in Python 3 is similar to that
When we develop the program, sometimes need to develop some automated tasks, after the completion of the results automatically send a copy of the message, Python send mail using the Smtplib module, is a standard package, direct import imports using,
Common keywordsHow to use keywords commonly used in loopsContinue: End this loop and proceed to the next loopbreak: Jump out of a loop or end a loopCasesLogin with username and password (three chance)Count=0While countUser=input (' Password=input ('
Compile type: Each statement of the source program is compiled into a machine language, and stored as a binary file, so that the computer can run the machine directly in the language to run the program, fast;interpreted type: only in the execution
#define a Python classclassCat:#The Self keyword is equivalent to the this pointer in a C + + class defEat (self):Print("I am eating.") defShow (self):Print("name is%s"%self.name); Tom=Cat () tom.eat ()#add a property to the Tom
One, for generating and modifying common configuration documents, the name of the current module is changed to Configparser in the python3.x version.Ii. configuration and generation of files1. CodeImport ConfigparserConfig = Configparser.
Therefore, when reading the dictionary, it is best to determine the type, and then see if it already has such a property: Type (mydict) = = Type ({}) #检查不是字典如果是字典, and then see if there is such a property: Mydict.has_key (' MyKey ') 1, see if the
Learned so long crawler, today tidy up the relevant knowledge points, will continue to updateHTTP and HTTPSHTTP protocol (Hypertext Transfer Protocol, Hypertext Transfer Protocol): is a way to publish and receive HTML pages.HTTPS (hypertext Transfer
1. About referencing global variables:Referencing a global variable is not something you can use, you can change it, and when you reference a global variable in a child function, you should declare that the variable is a global variable: such as
Pits that may be encountered in the underlying data type:Meta-group:The data type of tuple1= (1) is int, and the data type of tuple2= (' Alex ') is str etc.The data type for tuple1= (1,) and tuple2 is tupleList:Lists and lists can be added together,
Goal
Module
Package
Production of modules
01, Concept of Module 1.1 moduleNote module is a core concept of the Python program architecture
Each py python source code file that ends with an extension is a module
The
Inside class, you can have properties and methods, and external code can manipulate the data by invoking the instance variable directly, thus hiding the complex logic inside.However, from the previous definition of the student class, the external
is still the Python base for loop' Woeudbwieb ' for in S:#s represents an iterative object print(i)if'c ' not inch s: Print (' no c')ListEach element is separated by commas and can be placed in an arbitrary data type, orderedSlices and
Turn from: 71189486One, Cartesian product: Itertools.product (*iterables[, repeat])Cartesian product directly to itself:import itertoolsfor i in itertools.product(‘ABCD‘, repeat = 2): print (‘‘.join(i),end=‘ ‘)Output Result:AA AB AC AD BA BB BC BD
Tuples are also called read-only lists and cannot be modified by their contents1. Create a tupletuple1= (1,3,2,4,5) tuple2= () #空元组tuple3 = (' A ',) #元组中只有一个元素时要在元素后面加上逗号, otherwise it will be treated as a different data type tuple4= (1, ' a ', [], (
1, the definition of closures:When a child function has a call to a parent function variable (not a global variable) and returns a child function name, the parent function does not end the release as the function runs, but instead saves the state
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