1,Self is what, generally refers to the object itself, so said no use, said after it is still difficult to understand, because this said, still completely unclear, when the variable needs to add self, when do not need to add self.caused a lot of
non-replicated but content-consistent scenariosFirst generate the list list1,list2, view the content, compare the content, and compare the memory ID:List1 = List (range (5= List (range (5))print(list1)print(list2) Print(list1 = = list2)print("list1
For loopFirst, using the For loop for simple functions" "multiplication Table 1--9 multiplication table for loop for digital traversal" " forIinchRange (1,10):#in line forSinchRange (1,i+1):#column in Print('%s X%s=%s'% (s,i,s*i), end
If condition statement(1) If condition judgment: (colon)If 1==1:Print (' Really nothing ')ElsePrint (' It will be later ')Description of the # # # code block: In the same column as the code block, as above, if the print is a block of code.# #
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
Process: A process is a program that processes can use multi-core CPUs.Threads: the smallest execution unit in a process, working on a threadThere is at least one thread in a process (master thread) that can have multiple threads (child
Tag:sys append python children execution super field elf method import multiprocessing as mpfrom multiprocessing import processclass Myprocess (process): "" " custom multi-process, inherited from native process, to
Python decorator if used well, it is the great God, use the best not to use ...The adorner (decorator) mainly contains two large properties:1, can not change the original function call mode2, can not change the original function of the codeThe first
Aiohttpaiohttp is a module that supports HTTP requests based on the Asyncio module, which is more comprehensive than 8.4.2 " based on the Asyncio implementation of TCP analog HTTP requests "Install Aiohttp:PIP3 Install AiohttpAsyncio + aiohttp
Get maximum ValueEnter a number of integers to print the maximum value. If the input is empty, exit the programUse the while loop and the IF statement to determine its printing criteria:Print 99 multiplication tableUse the FOR Loop statement to
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-*-#=============================================
' = = ' 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
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
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