first edited October 28, 2017, SaturdaySummaryI. Last Class reviewTwo. Association function initialization AdornerThree. Send Implementation crawl Web pageFour. Process-oriented programmingFive. List-generatedSix. three-dimensional expressionSeven.
Shallow copy shallow copy and deep copyList.copy () Shallow copy: Copy this list (copy only one layer, do not copy deep objects) equivalent to l[:]Example:Shallow copy:A = [1.1, 2.2] # a = [1.1, 2.2]b = [1, 2, a] # b = [1, 2, [1.1, 2.2]]c = b.copy ()
ObjectiveVerification code This problem is more headache, for the Verification code processing, do not want to crack method, this verification code is to prevent others automated login. If you can decipher and explain your company's verification
Python variable principle: Numeric-based, numbers are stored in memory and assigned to different variables. Just the opposite of C.In Python, there are 3 built-in data structures: lists, tuples, and dictionaries.1. ListA list is a data structure
ObjectiveFile download time will pop up a download option box, this frame is not located, some elements are destined not to be able to locate it does not matter, when there is no mouse, we can use the keyboard shortcut keys to complete the operation.
ObjectiveOften someone in the group feedback, clearly code the same ah, why other people can report, I do not report; Why do people run the result is not the same as mine ah ...This problem first check the code, OK is the same, that is the wrong
How does python perform memory management?Python introduces a mechanism: reference counting.Python internally uses reference counting to keep track of objects in memory, and Python internally records how many references the object has, that is, the
Reflection1. Importing modules as strings2. In the form of a string, go to the module to find the specified function and execute" "def f1 (): Return ' F1 ' def f2 (): Return ' F2 '" "#Let's say the above is the contents of a py file called
(1) Double quotation marks can be used in single quotation marks, the middle will be as a string output (single quotation marks in the characters enclosed in single quotation marks, to be in single quotation marks with the escape character "\",
Log for the program to run and technical personnel is very necessary and very important, troubleshooting is generally from the analysis program to run the log, and then the complexity of the large program must have a log input, otherwise, even if
Meta-group
Tuple: The feature is the content is not variable, the list of read-only, can be queried, cannot be modifiedA = 2,print(a)print= ('a','b ','C')print(b[1])Operation Result:(2,)class'tuple'>bDictionary
Dictionary: Internal data
List-GeneratedLook at the 2-segment code first.A = [i*2 for i in range (10)]Print (a)#b = []For I in range (10):B.append (i*2)Print (b)A and B have the same effect, but the code used in A is more conciseList generation can also use functions to
Python provides support for multithreading through two standard libraries (thread, threading)Thread moduleImport TimeImportThreaddefRunner (ARG): forIinchRange (6): PrintSTR (i) +':'+Arg time.sleep (1) #End Current
Python Import module error importerror:no module named ' Request 'Import RequestImporterror:no module named ' Request 'If it is a requests third-party module, then you need to install,pip install requests, and then import requests can use thePython3
Daemon and joindaemon DaemonI. Preface
A program has at least one main thread. After the main thread is started, there is no affiliation between them. The main thread and subthread are executed in parallel and independent from each other. After the
Django basic commands, Django commands
1. Create a project
Django-admin.py startproject myblog
2. Create an app
Python manage. py startapp blog
3. Create a database table or change a database table or field
Python manage. py makemigrations
The Singleton mode is implemented by Python through _ new _. The differences between the _ new _ and _ init _ methods are __new ___ init _
Previously, I learned that the singleton mode can be implemented through the _ new _ method in Python. The
Python built-in type (4) -- value, python built-in
Python has three numeric types: integer, floating point numbers, and plural ). In addition, Boolean is the subtype of an integer.Value Type description
An integer is represented by 1-N numeric
Download the blog list on the blog homepage.
Url_con = urllib. urlopen ('HTTP: // blog.sina.com.cn/s/articlelist_1193111400_0_1.html '). read () print 'Con ', url_conurl = [''] * 40i = 0 title = url_con.find (R'
The above code is used to obtain
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