Socket function
Annotations:Close and shutdown--end data transfer of the socket: close-----Close the socket ID of this process, but the link is still open, other processes with this socket ID can also use this link to read or write the socket
The list is one of the most commonly used data types in the future, with lists that allow the most convenient storage, modification, and so on for the data to be defined list 1 names = ['Alex','tenglan','Eric ']To access the elements in the list by
File RenameRename () in the OS module can complete renaming of filesRename (need to modify the file name, the new file name)Import osos.rename ("11.txt""12.txt")deleting filesRemove () in the OS module can complete the deletion of the fileRemove
The priority of ' and ', ' or ' and ' not ' is not>and>orFirst, the priority of ' and ', ' or ' and ' not ' is not>and>or.The result of And:x and Y returns is the value that determines the result of the expression. If x is true, Y determines the
A function is a part that aggregates some statements together, they can run more than once in a program, the function can also calculate a return value, and can change the parameters as input to the function. These parameters are different every
1. Judgment statement: It is often used to judge whether the condition is satisfied.If, if...else ..., if...elif...else ..., if nested.2. Circular statementsWhile: Generally, whether the value satisfies the loop condition.For: A variable that can
Asyncio the asynchronous IO request operation:
1. @asyncio. Coroutine Decoration Task function
2. Use "fixed format" with yield from and adorner @asyncio.coroutine in function
3. Loop = Asyncio.get_event_loop ()
Python3, crawling is Baidu translation mobile version of the Web page
Using the Requests,json module
Translation between English and Chinese, running results
#!/bin/python3#-*-coding:utf-8-*-#=============================================
Python Dafa good-object-orientedPython has been an object-oriented language since its inception, which is why it is easy to create a class and object in Python. In this section we will detail Python's object-oriented programming.If you have not been
' = = ' compares the values of two objects' Is ' compares the memory address (ID) of two objectsBelow we focus on understanding ' is '. For this, we need to know: Small integer object pool, large integer object pool, and intern mechanismSmall
Installationsudo apt install virtualenvOriginally used PIP3 installed virtualenv, but the use of the time will still be prompted to find.Create a virtual environmentsudo virtualenv -p /usr/bin/python3.6 venv_name #venv_name即为虚拟环境名称
Here,
Python is dynamic language 1. Definition of dynamic language动态编程语言is 高级程序设计语言 a category that has been widely used in the field of computer science. It is a class 运行时可以改变其结构 of languages: for example, new functions, objects, even code can be
One: The use of function names1. memory address of Function namedef func (): Print (" hehe ") Print (func) Result:2. Function names can be assigned to other variables def func (): Print (" hehe ") Print # assign a function as a variable
= = Determines whether the values on both sides are equalis to determine if the memory address on both sides is the sameSmall Data pool int-5 to 256STR has no special charactersThe ASCII code does not support Chinese eight bits of a byteGBK Code GB
While loop结构:while 条件: 循环语句Dead loopwhile True: 没有break语句情况下Terminating loopsFirst, change the condition (the concept of the sign bit): The flag is usually used as the mark bit by default.flag = Truenum = 0while flag: print(num) num =
For list, set, Dict, the value is directly assigned. The memory address is actually given to the variable. is not a copy of the content.The content of the two variables is actually an address, and if you want to assign a new address while copying it,
One: defineEncapsulation and definition of code blocks and functionsTwo: function definition, function name, function body and function callWe use the DEF keyword to define the function, which defines the syntax for the function: def function
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