---restore content starts---0x01 Socket First Family Af_unixAddress family: Addresses Family:unix file-based socketsType II Af_inetAddress family: InternetType III: Af_netlink (no connection type)Allows the use of the BSD socket user interface for
FunctionFirst, IntroductionDefinition: A function is a collection of a set of statements by a name (function name) encapsulated, in order to execute this function, just call its function name.Characteristics:
Reduce duplicate code
To
The content of this section1, Isinstance (OBJ,CLS) and Issubclass (Sub,super)2. Reflection3, __setattr__,__delattr__,__getattr__
I, Isinstance (OBJ,CLS) and Issubclass (Sub,super)
1. Isinstance (obj,cls) Check if obj is an
Attention! Attention! Attention!It is strongly recommended to use PIP installation since Lib Library is installed:Reason:NU1: With EXE installation will appear a variety of unexpected surprises you!!!NU2: This kind of mistake is difficult to solve
Output 9*9 multiplication table.For I in range (1, ten): Print for J in range (1, i+1): print "%d*%d=%d"% (i, J, I*j);650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8E/68/wKiom1i_oFewOu4MAAAcnspcfRw204.png-wh_500x0-wm_ 3-wmp_4-s_77511466
ObjectiveSometimes it is not easy to find an element on the page by the attribute of the element, and you can crawl the information from the source. Selenium the Page_source method can get to the page source code.Selenium of the Page_source method
1. What is a dictionary?A dictionary is a data structure that refers to a value by its name, which is called a mapping and is the only built-in mapping type in Python.2. Why use a dictionary?A dictionary can easily be traced to its definition (value)
Ternary operations:if + = = 2:p rint (True) Else:print (false) #等同于: print (True if 1+1==2 else False)Basic syntax of the function Def XX ():Define function # return AA return value # or pass nothing Returns # XX () Call function # The function has
f = open (' Test.txt ', ' R ')' R ':' W ':' X ':' A ':' R+ '' w+ '' A + '
F.read ([size])
Reads a size byte that reads all remaining bytes when not specified or given a negative value, returning as a string
JSON (JavaScript Object Notation) is a lightweight data interchange format. It is based on a subset of ECMAScript. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, Java,
Gets any key-value pairs in the dictionary
>>> x={' A ': 1, ' B ':2}>>> key,value=x.popitem () >>> key,value (' A ', 1) >>> del X[key] Traceback (most recent): File "", line 1, in del x[key]keyerror: ' A ' &G t;>> x{' B ': 2}>>> x[key]=value>>>
The global configuration of the project under directory Mydjangoproject is setttings.py, urls.py, and wsgi.py, respectively,
1, which setttings.py includes the system database configuration, application configuration and other configuration,2.
Fibonacci sequence
>>> fibs[0, 1]>>> n=input (' How many Fibonacci numbers does your what? ') How many Fibonacci numbers does your what?10>>> for n in range (n-2): fibs.append (fibs[-2]+fibs[-1]) >& Gt;> fibs[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
If we have two Django apps site1 and site2 running on different ports of the same server at the same time, we have different tab logins in the same browser. That's when this happens, and when we log in to Site2, we kick the user who's logged on site1
There are two defects in Excel self-processing methods, such as Excel, Matlab and Python, which are widely used in the paper .
1. When the data is more, Excel "pounder" phenomenon is easy to appear;
2. It is more convenient to use MATLAB or Python
1. How Crawlers work
The web crawler, the spider, is a very vivid name. The internet is likened to a spider's web, so spiders are crawling around the web. Web spiders are looking for Web pages through the URL of a Web page. From one page of the
for map () its prototype is: Map (function,sequence), which is to perform function functions on each element of the sequence sequence.
For example, the previous a,b,c = Map (Int,raw_input (). Split ()), meaning that the input a,b,c is converted to
In python, it is easy to use the OS module to run other scripts or programs so that the functionality provided by other scripts or programs can be used directly in the script without having to write code that implements that functionality Again. To
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