classes or instances. Both of them are characterized by the inability to call instance attributes.
E. g1:
Class:
Member = "this is a test ."
Def _ init _ (self ):
Pass
@ Classmethod
Def Print1 (cls ):
Print "print 1:", cls. member
Def Print2 (self ):
Print "print 2:", self. member
@ Classmethod
Def Print3 (paraTest ):
Print "print 3:", paraTest. member
@ Staticmethod
Def print4 ()
implemented using annotations
acclimate-a generic interface that relies on injection containers and service positioning
Imagery imageLibrary for working with images
imagine-an image processing library
PHP image workshop-Another processing library
Intervention image-another image processing library
GIF frame extractor-a library for extracting animated frame information from GIF
GIF creator-A library that creates GIF animations from multiple images
Image with
injection container
Auryn: another small dependency injection container
Orno Di: a scalable dependency injection container
Php di: a dependency injection implemented using annotation
Acclimate: Common Interface for Injection containers and service locators
Image-image processing database
Imagine: an image processing database
PHP Image Workshop: Another Image processing library
Intervention Image: It is also an Image processing library.
GIF Frame Extractor: a library that extracts GIF animation
:",self.member @classmethoddefPrint3(paraTest):print"print3:",paraTest.member a=A()A.Print1()#相当于Print1(A)a.Print2()#相当于Print2(a),请注意@classmethodA.Print3() As you can see, Python is passing the "." When a member function is called, the "." The preceding thing is called as the first parameter of a function. And Pyhon doesn't care what we put the name of the first parameter of the member function of the class, we can use any name, we can see the definit
– A library that creates GIF animations from multiple imagesImage with text-a library that embeds text in an imageColor Extractor-a library that extracts colors from an imageTesting testTest code and libraries that generate test dataPHPUnit-a unit test frameworkDbunit-phpunit Database Test LibraryParallel Test library for Paratest–phpunitPHPSPEC-Unit Test library based on function point designCodeception-a full stack test frameworkAspectmock–phpunit/c
GIF frame extractor-a library for extracting animated frame information from GIF
GIF creator-A library that creates GIF animations from multiple images
Image with text-a library that embeds text in an image
Color extractor-a library that extracts colors from an image
Testing testTest code and libraries that generate test data
phpunit-a unit Test framework
Dbunit-phpunit Database Test Library
Parallel Test library for Pa
."
def __init__ (self):
Pass
@classmethod
def Print1 (cls):
print "Print 1:", cls.member
def Print2 (self):
print "Print 2:", self.member
@classmethod
def Print3 (paratest):
Print "Print 3:", Paratest.member
@staticmethod
def print4 ():
print "Hello"
Summary: Class properties and class methods are intrinsic to the class and properties, not because of the different instances of the change, write their pu
to the test code by Testng.xmlPackage Tanklearn2.learn;import Org.testng.annotations.parameters;import Org.testng.annotations.test;public class ParameterizedTest1 { @Test @Parameters ("test1") public void Paratest (String test1) { System.out.println ("This is" + test1);} }Testng.xmlMode two: passing parameters via DataproviderPackage Tanklearn2.learn;import Org.testng.annotations.dataprovider;import Org.testng.annotations.test;
animations from multiple images
Image with text-a library that embeds text in an image
Color extractor-a library that extracts colors from an image
Testing testTest code and libraries that generate test data
phpunit-a unit Test framework
Dbunit-phpunit Database Test Library
Parallel Test library for Paratest-phpunit
phpspec-Unit Test library based on function point design
codeception-a full stack test framework
Http://www.cnpythoner.com/post/308.htmlhttp://www.cnpythoner.com/post/308.htmlThese three words appear in the Python class, and the self and the CLS can be replaced by other words, and there are three methods of the class.One is defined by Def, the ordinary general, need to pass at least one parameter, generally with self, such a method must be accessed through an instance of a class, similar to C + + through the object to access;The second is to add @classmethod in front of Def, this kind of me
Contact Us
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.