The role of 1.superCalling the parent class method2. Example of single-inheritance use#Coding:utf-8#Single InheritanceclassA (object):def __init__(self): SELF.N=2defAdd (self,m): SELF.N+=mclassB (A):def __init__(self): SELF.N=3defAdd (self,m): Super
Very similar to open source software MQFIFO logic, one, n A, 1, n listen qFrom multiprocessing import Process,queue#队列, FIFOQ=queue (3)Q.put ({' A ': 1})Q.put (' B ')Q.put (' C ')Print (Q.full ())--FullQ.put (' d ', False) #等同于q. put_nowait (' d ')
Scope of the functionis the nearest principle, look out from inside, if you have in your function, take it.If you do not have a function inside of it, go to its parent function inside find, father can't use son, son can use father'sfunction is
in order to correlate individual properties. The UUID work number attribute is used. Each object has a unique property. In addition to ensure that the object is unique. I gave each object a hash of the properties and generated a unique property. The
"Summary" Python programming Core Knowledge systemBook of the Great God, from: https://woaielf.github.io/2017/06/13/python3-all/This article mainly covers the core knowledge of Python programming (not including the standard library and third-party
Module:A module is essentially a Python program.All that is said to be an object must be done by the object. method to implement some operations.Module Type:Built-in ModulesThird-party modulesCustom ModulesImport in the order of finding modules:
ObjectiveAs we all know, the language of Python is not only easy to learn, but also very useful. I also recently joined the Army of learning Python, hoping to use this language to make myself more effective.For today, Python is about the part of the
1. Creation of functionsdef # definition Print ('hellow') # Execution Code of the function Retrun 1 # return value fun () # Execute function2. Parameters of the functionCommon parameters: To enter parameters in
#try ... finally whether or not an exception is performed finally#例如实现不管是否异常都输出一串字符串‘‘‘TryPrint IFinallyPrint "Regardless of whether it is abnormal, I must output"TryI=7Print IFinallyPrint "Regardless of whether it is abnormal, I must
Selenium is a Web test application framework that can also be used as a crawler.1. Installing the Selenium modulePip Install-u Selenium2. After installing the Selenium module, the corresponding browser driver is required.A. Using PHANTOMJSPHANTOMJS
message boxImportImport Tkinter Import # This is the message box, the key to the dialog boxPrompt message boxTkinter.messagebox.showinfo (' hint ',' life is short ')Message Warning BoxTkinter.messagebox.showwarning (' warning ',' rain tomorrow
1. List of lists
Definition List
>>> alist=[' Lydia ', ' Miranda ', ' Tony ', ' Cody ', ' lorries '>>> Print (alist)[' Tom ', ' Ruby ', ' Eddie ', ' Eric ']
Access the elements in the list by subscript
>>> Alist[0]'
For I in range (1,5):For j in Range (1,5):for k in range (1,5):if (i!=j) and (J!=k) and (i!=k):Print I,j,k#任意三个数可组成多少不重复的三位数St=[]For I in Range (1,4):Sa=int (Raw_input (' Your Number: '))St.append (SA)For L in St:For M in St:For N in St:if (l!=m)
Continue the content of the previous article, in the previous article, the crawler scheduler has been written, the scheduler is the entire crawler "brain", can also be called command center. And now, all we have to do is write the other components
Linux Environment:
You can use the mirror source directly, plus-I specify the address:
1 sudo pip install-i module name
If a non-trusted error occurs:
You need to add the command after the
1 sudo pip install-i --trusted-host
Object-oriented:
Concept: Class, instantiation, object, instance
Property:
Public properties: Defined in class
Member properties: defined in method
Private properties: Restrict external access by using the __ property definition in a method
Friend full head
Words don't say much, directly on the code
Import Itchatimport Mathimport PIL. Image as Imageimport ositchat.auto_login () friends = Itchat.get_friends (update=true) [0:]user = friends[0]["UserName"] num = 0for i in Friends: img
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