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 ()
' = = ' 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,
1. Development language:Advanced languages: Python, Java, PHP, C #, Go, Ruby, C + + ==> bytecodeLow-level language: C, assembly ==> Machine code2. Comparison of development languages:PHP class: For writing Web pages, limitationsPYthon Java: Can
The * and * * In Python allow the function to support any number of arguments, which have different purposes in function definition and invocation.I. Packing parameters* Function: In the function definition, collect all positional parameters into a
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
Django ORM Operations1. Field OperationsClass User (model. Model);u= FieldUse:1. Field validation in admin2. Obj.clean_fields () for custom validation3. Use Djanfo form for verification, at which time the foreground and background operations are
First, crawl processSecond, the Code demonstration#-*-coding:utf-8-*-#_author: alexcthon#mail:[email protected] #date: 2018/8/3import requestsfrom Multiprocessing Import Pool # process pools, used to implement seconds capture from
The structure of the Config.ini file is the following: The structure is a section, a part of the structure under the "[]". There are three sections below, each of which is Section0,section1,section2[MySQL
1.while CycleFormat: While conditional expression:Loop Body Statement 1Loop Body Statement 2Printing 1 to 101 number = 12 while number :3 print(number) 4 Number = number + 15 Print (number)Note: Python uses the same indentation to represent
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