Static methods
Class method
Property method
First, static methodYou can use the @staticmethod adorner to turn a method into a static method. A static method cannot be a method instance variable or a class variable, that is, you cannot
# This is a learning note for the Liaoche teacher Python tutorial1. OverviewThe keyword lambda represents an anonymous functionList (map (lambda x:x * x, [1, 2, 3, 4, 5, 6, 7, 8, 9]))# The Lambda in the list-building is actuallydef f (x):return x *
ReviewThe main function of form is to do data validation. and the data validation function of the form is powerful.The form also has another function, which is to help me generate HTML tags.The above 2 features, where validation is the primary, and
Single-Process server 1. Complete a Simple TCP server fromSocketImport*Sersocket=socket (af_inet, sock_stream)#reusing information for bindingsSersocket.setsockopt (Sol_socket, SO_REUSEADDR, 1) Localaddr= ("', 7788) Sersocket.bind (localaddr)
First, download the relevant Chinese font Simhei file:Second, find the Matplotlib data storage location by the following code:Import matplotlib Print (Matplotlib.matplotlib_fname ())My directory is:
# This is a learning note for the Liaoche teacher Python tutorial1 , overview We have learned list, tuple, dict, set, str , Span style= "Font-family:simsun;background:lime;background:lime" >generator, generator function These can be used
Formatted output mode one: (%s)We will often output similar ' Dear XXX Hello! You xx month of the charge is XX, the balance is xx ' such as the string ', and the content of XXX is based on variable changes, so, need a simple way to format the string.
First, the Zen of Pythonin the Python shell, enterimport this, it will show Tim Peters'sThe Zen of Python:The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better
2. The programmeFor the above API, when doing interface testing, the test cases need to be up to 10 +, this time in a data-driven way to write the common content of the configuration file may be more appropriate.Here consider the API, parameters,
Python meta-classBefore thinking clearly to write in the notes, recently saw python3.6 another __init_subclass__ , before the things completely forgotten. This is a summary.NEW: Combine JavaScript's prototype chain to realize the idea of all objects
The Pytho range () function creates a list of integers, which is typically used in a for loop.function syntaxRange(start, stop[, step]) Parameter description:
Start: Count starts from start. The default is starting from 0. For example,
Learning Selenium+python has been a few months, but the more you learn to find the more things do not understand. The biggest problem is the foundation is not solid, decided to start from scratch, every day to read the code, write code. Believe that
Python's objects are said to have some magical methods that are always surrounded by double underscores, all of which are object-oriented python.They are a special way to add magic to your class, and if your object implements (overloads) one of
ObjectiveBackground: Do WAP page automation, the URL address directly into the browser (Chrome browser has a mobile phone WAP mode) on the test, there is a button alive and dead Point, with the WAP mode touch event can not be solved, and then want
ObjectiveAutomation takes four steps: Get elements, manipulate elements, get return results, assert (return results are consistent with expected results), and finally automatically test reports. This article is mainly about how to use the Firefox
ObjectiveIn the previous unittest, the setup can be executed before each execution of the use case, which effectively reduces the amount of code, but there is a drawback, such as opening a browser operation, which is reopened every time the use case
Log analysis
The business will generate a large number of system logs, application logs, security logs, etc., through the analysis of the log can understand the load of the server, health, can analyze the distribution of customers,
Basic knowledgeFirst, Python is an interpreted language, that is, the program does not need to compile, at run time to translate into machine language, every execution once to translate once, so less efficientIi. explanatory language and compiled
ObjectiveAbout non-input file upload, click the upload button, this pop-up windows control, has jumped out of the three boundaries, not part of the jurisdiction of selenium (selenium is not omnipotent, can only manipulate elements on the web). The
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